newtests/test.py
Go to the documentation of this file.00001
00002 """Run all tests"""
00003
00004 __author__ = "Martin Alnes <martinal@simula.no>"
00005 __date__ = "2008-09-04 -- 2008-09-04"
00006
00007 import os, glob
00008
00009
00010 import sfc
00011 sfc.set_logging_level("error")
00012
00013
00014 tests = glob.glob("*.py")
00015 skip = set(["test.py", "template.py", "cell_assembly.py"])
00016 tests = (t for t in tests if not (t in skip or t.startswith("_")))
00017
00018
00019 separate = True
00020 if separate:
00021
00022 for test in tests:
00023 cmd = "python %s" % test
00024 print "Running '%s'" % cmd
00025 os.system(cmd)
00026 else:
00027
00028 classes = []
00029 for test in tests:
00030 classes.extend(test.tests)
00031
00032
00033 verbosity = 0
00034 suites = [unittest.makeSuite(c) for c in classes]
00035 testsuites = unittest.TestSuite(suites)
00036 unittest.TextTestRunner(verbosity=verbosity).run(testsuites)
00037