Coverage for gpkit\tests\run_tests.py: 0%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Script for running all gpkit unit tests"""
2from gpkit.tests.helpers import run_tests
5def import_tests():
6 """Get a list of all GPkit unit test TestCases"""
7 tests = []
9 from gpkit.tests import t_tools
10 tests += t_tools.TESTS
12 from gpkit.tests import t_sub
13 tests += t_sub.TESTS
15 from gpkit.tests import t_vars
16 tests += t_vars.TESTS
18 from gpkit.tests import t_nomials
19 tests += t_nomials.TESTS
21 from gpkit.tests import t_constraints
22 tests += t_constraints.TESTS
24 from gpkit.tests import t_nomial_array
25 tests += t_nomial_array.TESTS
27 from gpkit.tests import t_model
28 tests += t_model.TESTS
30 from gpkit.tests import t_solution_array
31 tests += t_solution_array.TESTS
33 from gpkit.tests import t_small
34 tests += t_small.TESTS
36 from gpkit.tests import t_examples
37 tests += t_examples.TESTS
39 from gpkit.tests import t_keydict
40 tests += t_keydict.TESTS
42 return tests
45def run(xmloutput=False, tests=None, verbosity=1):
46 """Run all gpkit unit tests.
48 Arguments
49 ---------
50 xmloutput: bool
51 If true, generate xml output files for continuous integration
52 """
53 if tests is None:
54 tests = import_tests()
55 if xmloutput:
56 run_tests(tests, xmloutput='test_reports')
57 else: # pragma: no cover
58 run_tests(tests, verbosity=verbosity)
60if __name__ == "__main__": # pragma: no cover
61 run()