-
Notifications
You must be signed in to change notification settings - Fork 3
/
run_tests.py
51 lines (40 loc) · 1.38 KB
/
run_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""Script for running all unit tests"""
import gpkit
from gpkit.tests.run_tests import run
from gpkit.tests.test_repo import git_clone, pip_install
def import_tests():
"""Get a list of all robust unit test TestCases"""
tests = []
from robust.testing import t_equivalent_posynomials
tests += t_equivalent_posynomials.TESTS
from robust.testing import t_linearization
tests += t_linearization.TESTS
from robust.testing import t_primitives
tests += t_primitives.TESTS
from robust.testing import t_robust_gp_tools
tests += t_robust_gp_tools.TESTS
from robust.testing import t_two_term_approximation
tests += t_two_term_approximation.TESTS
from robust.testing import t_simulation
tests += t_simulation.TESTS
from robust.testing import t_legacy
tests += t_legacy.TESTS
return tests
def test():
try:
import gpkitmodels
except:
git_clone("gplibrary")
pip_install("gplibrary", local=True)
alltests = import_tests()
TESTS = []
for testcase in alltests:
for solver in gpkit.settings["installed_solvers"]:
if solver:
test = type(str(testcase.__name__+"_"+solver),
(testcase,), {})
setattr(test, "solver", solver)
TESTS.append(test)
run(tests=TESTS, xmloutput=True)
if __name__ == '__main__':
test()