2011-12-22 01:36:26 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
'''
|
|
|
|
Discover all instances of unittest.TestCase in this directory.
|
|
|
|
'''
|
2012-02-12 08:24:20 +00:00
|
|
|
# Import python libs
|
|
|
|
import os
|
2012-02-12 09:58:15 +00:00
|
|
|
# Import salt libs
|
2012-02-12 23:03:31 +00:00
|
|
|
import saltunittest
|
2012-02-20 12:18:13 +00:00
|
|
|
from integration import TestDaemon
|
2012-02-12 09:58:15 +00:00
|
|
|
|
2012-02-12 23:03:31 +00:00
|
|
|
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
|
2011-12-22 01:36:26 +00:00
|
|
|
|
2012-02-20 12:18:13 +00:00
|
|
|
def run_integration_tests():
|
|
|
|
with TestDaemon():
|
2012-02-19 23:07:38 +00:00
|
|
|
loader = saltunittest.TestLoader()
|
2012-02-20 12:18:13 +00:00
|
|
|
tests = loader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
|
2012-02-19 23:07:38 +00:00
|
|
|
saltunittest.TextTestRunner(verbosity=1).run(tests)
|
2011-12-22 01:36:26 +00:00
|
|
|
|
2012-02-20 12:18:13 +00:00
|
|
|
def run_unit_tests():
|
|
|
|
loader = saltunittest.TestLoader()
|
|
|
|
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
|
|
|
|
saltunittest.TextTestRunner(verbosity=1).run(tests)
|
|
|
|
|
2012-02-12 08:24:20 +00:00
|
|
|
|
2011-12-22 01:36:26 +00:00
|
|
|
if __name__ == "__main__":
|
2012-02-20 12:18:13 +00:00
|
|
|
run_integration_tests()
|
|
|
|
run_unit_tests()
|