[cig-commits] commit: Updated testAll.py script to include results summary.

Mercurial hg at geodynamics.org
Mon Feb 1 15:31:55 PST 2010


changeset:   381:84d4b74cf385
user:        JericoRevote
date:        Wed Jan 13 22:24:53 2010 +1100
files:       SysTest/RegressionTests/testAll.py
description:
Updated testAll.py script to include results summary.


diff -r 41661372a1fc -r 84d4b74cf385 SysTest/RegressionTests/testAll.py
--- a/SysTest/RegressionTests/testAll.py	Wed Jan 13 21:01:30 2010 +1100
+++ b/SysTest/RegressionTests/testAll.py	Wed Jan 13 22:24:53 2010 +1100
@@ -1,6 +1,8 @@
 #! /usr/bin/env python
 
 import os
+import sys
+import subprocess
 
 def runTests():
     
@@ -9,7 +11,39 @@ def runTests():
                 './analyticTest.pl AnalyticShearXZ.xml -optionsFile np-4.dat', \
                 './analyticTest.pl AnalyticShearXZ.xml -optionsFile np-8.dat']
 
+    failed_commands = [] 
+    passed = 0
+    failed = 0
+ 
     for command in commands:
-        os.system( command )
+        try:
+            retcode = subprocess.call( command+' -serial' , shell=True )
+            if retcode == 0:
+                 passed += 1
+            else:
+                 failed += 1
+                 failed_commands.append( command )
+        except OSError, e:
+            print >>sys.stderr, "Execution Failed:", e
+
+    filename = "../../../summary.dat"
+
+    if os.path.exists( filename ):
+        FILE = open( filename, "a" )
+    else:
+        FILE = open( filename, "w" )
+
+    message = ''
+    message += "--------------------------------------------------------\n" + \
+          "[SYS] PICellerator Normal-Res Integration Tests:\n" + \
+          "[SYS]      Total Passes: (" + str(passed) + "/" + str(len( commands )) + ")\n" \
+          "[SYS]      Failed Commands:\n"
+    for command in failed_commands:
+        message += "[SYS]            " + command + "\n"
+    message += "--------------------------------------------------------\n"
+    FILE.write( message )
+    print message
+    FILE.close()
+
 
 runTests()



More information about the CIG-COMMITS mailing list