[cig-commits] commit: Updated testAll.py script to include results summary.
Mercurial
hg at geodynamics.org
Fri Feb 5 12:09:15 PST 2010
changeset: 388:e30267212c55
branch: 1.4.x
parent: 375:3e7d7877c283
user: JericoRevote
date: Thu Jan 14 17:40:20 2010 +1100
files: SysTest/RegressionTests/testAll.py
description:
Updated testAll.py script to include results summary.
diff -r 3e7d7877c283 -r e30267212c55 SysTest/RegressionTests/testAll.py
--- a/SysTest/RegressionTests/testAll.py Thu Jan 07 16:52:55 2010 +1100
+++ b/SysTest/RegressionTests/testAll.py Thu Jan 14 17:40:20 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