ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #02062
test script error code patch
Hi,
please apply the attached patch that modifies test/test.py so that it
returns an error code different from zero (success) on failure. This way
the buildbot will notify ffc-dev when some of the tests fails.
Johannes
# HG changeset patch
# User Johannes Ring <johannr@xxxxxxxxx>
# Date 1234786232 -3600
# Node ID 98ac7c4aecf4f6c960102a3e205ff93a14801af2
# Parent 82bdc244ad7f6650e13da7e554d39fffc5ed6fc7
Return error code != 0 on failure.
diff -r 82bdc244ad7f -r 98ac7c4aecf4 test/test.py
--- a/test/test.py Mon Feb 16 12:34:35 2009 +0100
+++ b/test/test.py Mon Feb 16 13:10:32 2009 +0100
@@ -7,16 +7,23 @@
import os
import re
+import sys
pwd = os.path.dirname(os.path.abspath(__file__))
# Tests to run
tests = ["unit", "regression"]
+failed = []
+
# Run tests
for test in tests:
print "Running tests: %s" % test
print "----------------------------------------------------------------------"
os.chdir(os.path.join(pwd, test))
- os.system("python test.py")
+ failure = os.system("python test.py")
+ if failure:
+ failed.append(test)
print ""
+
+sys.exit(len(failed))
References