Merge pull request #114 from bblacey/set-exitcode-on-unittest-failure
Exit with non-zero status when unit tests fail.
This commit is contained in:
@@ -32,9 +32,10 @@
|
|||||||
|
|
||||||
Log ("FreeCAD test running...\n\n")
|
Log ("FreeCAD test running...\n\n")
|
||||||
|
|
||||||
import TestApp;TestApp.TestText("TestApp.All")
|
import TestApp, os
|
||||||
|
|
||||||
|
testResult = TestApp.TestText("TestApp.All")
|
||||||
|
|
||||||
Log ("FreeCAD test done\n")
|
Log ("FreeCAD test done\n")
|
||||||
|
|
||||||
|
os._exit(0 if testResult.wasSuccessful() else 1)
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ def All():
|
|||||||
def TestText(s):
|
def TestText(s):
|
||||||
s = unittest.defaultTestLoader.loadTestsFromName(s)
|
s = unittest.defaultTestLoader.loadTestsFromName(s)
|
||||||
r = unittest.TextTestRunner(stream=sys.stdout, verbosity=2)
|
r = unittest.TextTestRunner(stream=sys.stdout, verbosity=2)
|
||||||
r.run(s)
|
return r.run(s)
|
||||||
|
|
||||||
|
|
||||||
def Test(s):
|
def Test(s):
|
||||||
@@ -72,7 +72,7 @@ def Test(s):
|
|||||||
|
|
||||||
def testAll():
|
def testAll():
|
||||||
r = unittest.TextTestRunner(stream=sys.stdout, verbosity=2)
|
r = unittest.TextTestRunner(stream=sys.stdout, verbosity=2)
|
||||||
r.run(All())
|
return r.run(All())
|
||||||
|
|
||||||
|
|
||||||
def testUnit():
|
def testUnit():
|
||||||
|
|||||||
Reference in New Issue
Block a user