dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #07289
Re: Running tests
The way is is now, the test.py script exit with code 0 even if all tests
fail (see http://fenics.org:8010/dolfin/mac_osx/builds/72/step-test/0)
Sending a patch to fix this.
ilmar
Anders Logg wrote:
The test suite seems to be working now. To run all tests, including
both the unit tests and system tests, just enter the test directory
and run
python test.py
Everyone is encouraged to run this before committing and pushing.
At some point, we might want to consider adding a suite of regression
tests and also expand the unit tests.
diff -r 0adac57d7407 test/test.py
--- a/test/test.py Wed Apr 09 13:58:34 2008 +0200
+++ b/test/test.py Wed Apr 09 15:22:43 2008 +0200
@@ -7,14 +7,22 @@ __license__ = "GNU LGPL version 2.1"
from os import system
from commands import getoutput
-import re
+import re, sys
# Tests to run
tests = ["unit", "system"]
+
+failed = []
# Run tests
for test in tests:
print "Running tests: %s" % test
print "----------------------------------------------------------------------"
- system("cd %s; python test.py" % test)
+ fail = system("cd %s; python test.py" % test)
+ if fail:
+ failed.append(fail)
print ""
+
+sys.exit(len(failed))
+
+
Follow ups
References