Skip to content
This repository
Newer
Older
100644 39 lines (34 sloc) 1.555 kb
595d9092 » ojii
2012-06-07 almost done with venv stuff (=tons of failing tests :D)
1 from cms.test_utils.cli import configure
2 import argparse
3 import sys
4
5
6 def main():
7 parser = argparse.ArgumentParser()
8 parser.add_argument('--jenkins', action='store_true', default=False,
9 dest='jenkins')
10 parser.add_argument('--jenkins-data-dir', default='.', dest='jenkins_data_dir')
11 parser.add_argument('--coverage', action='store_true', default=False,
12 dest='coverage')
13 parser.add_argument('--failfast', action='store_true', default=False,
14 dest='failfast')
15 parser.add_argument('--verbosity', default=1)
16 parser.add_argument('--time-tests', action='store_true', default=False,
17 dest='time_tests')
18 args = parser.parse_args()
19 args.urlconf = 'cms.test_utils.project.urls'
20 if getattr(args, 'jenkins', False):
21 TEST_RUNNER = 'cms.test_utils.runners.JenkinsTestRunner'
22 else:
23 TEST_RUNNER = 'cms.test_utils.runners.NormalTestRunner'
24 JUNIT_OUTPUT_DIR = getattr(args, 'jenkins_data_dir', '.')
25 TIME_TESTS = getattr(args, 'time_tests', False)
26 configure(TEST_RUNNER=TEST_RUNNER, JUNIT_OUTPUT_DIR=JUNIT_OUTPUT_DIR,
27 TIME_TESTS=TIME_TESTS, ROOT_URLCONF='cms.test_utils.project.urls')
28 from django.conf import settings
29 from django.test.utils import get_runner
30 TestRunner = get_runner(settings)
31
32 test_runner = TestRunner(verbosity=args.verbosity, interactive=False, failfast=args.failfast)
33 failures = test_runner.run_tests(['cms', 'menus'])
34 if failures:
35 sys.exit(bool(failures))
36
37
38 if __name__ == '__main__':
39 main()
Something went wrong with that request. Please try again.