Skip to content

Commit

Permalink
Merge pull request #114 from bblacey/set-exitcode-on-unittest-failure
Browse files Browse the repository at this point in the history
Exit with non-zero status when unit tests fail.
  • Loading branch information
wwmayer committed Mar 10, 2016
2 parents 3ca1ec2 + 272cbd1 commit ed61d65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/App/FreeCADTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@

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")

os._exit(0 if testResult.wasSuccessful() else 1)
4 changes: 2 additions & 2 deletions src/Mod/Test/TestApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def All():
def TestText(s):
s = unittest.defaultTestLoader.loadTestsFromName(s)
r = unittest.TextTestRunner(stream=sys.stdout, verbosity=2)
r.run(s)
return r.run(s)


def Test(s):
Expand All @@ -72,7 +72,7 @@ def Test(s):

def testAll():
r = unittest.TextTestRunner(stream=sys.stdout, verbosity=2)
r.run(All())
return r.run(All())


def testUnit():
Expand Down

0 comments on commit ed61d65

Please sign in to comment.