Update example runner to exit 1 on failure

This commit is contained in:
Brian O'Connor
2017-01-12 16:11:24 -08:00
parent 51f50e8b8f
commit 03b1cbb347
+2 -1
View File
@@ -32,7 +32,8 @@ def runTests( testDir, verbosity=1 ):
# discover all tests in testDir # discover all tests in testDir
testSuite = unittest.defaultTestLoader.discover( testDir ) testSuite = unittest.defaultTestLoader.discover( testDir )
# run tests # run tests
MininetTestRunner( verbosity=verbosity ).run( testSuite ) success = MininetTestRunner( verbosity=verbosity ).run( testSuite ).wasSuccessful()
sys.exit( 0 if success else 1 )
if __name__ == '__main__': if __name__ == '__main__':
# get the directory containing example tests # get the directory containing example tests