2013-09-21 22:27:41 +00:00
|
|
|
import unittest
|
2013-09-21 22:34:15 +00:00
|
|
|
import platform
|
2014-10-25 21:26:41 +00:00
|
|
|
import sys
|
2013-09-21 22:27:41 +00:00
|
|
|
|
2013-09-21 22:34:15 +00:00
|
|
|
if platform.python_version() < '2.7':
|
|
|
|
unittest = __import__('unittest2')
|
|
|
|
else:
|
|
|
|
import unittest
|
2013-09-21 22:27:41 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
testsuite = unittest.TestLoader().discover('testcases',pattern="*.py")
|
2014-10-25 21:26:41 +00:00
|
|
|
results = unittest.TextTestRunner(verbosity=100).run(testsuite)
|
|
|
|
|
|
|
|
# Return an error code if any of the testsuite tests fail
|
|
|
|
if len(results.errors) > 0:
|
|
|
|
sys.exit(1)
|
2013-09-21 22:27:41 +00:00
|
|
|
|
|
|
|
|