-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyctest-runner.py
executable file
·59 lines (53 loc) · 1.76 KB
/
pyctest-runner.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
52
53
54
55
56
57
58
59
#!/usr/bin/env python
import os, sys, platform, traceback
import pyctest.pyctest as pyctest
import pyctest.helpers as helpers
# -------------------------------------------------------------------------------------- #
def run_pyctest():
cwd = os.getcwd()
# process standard arguments
helpers.ArgumentParser(
"PyCTest", cwd, cwd, vcs_type="git", build_type="MinSizeRel"
).parse_args()
# base web address of dashboard
pyctest.DROP_SITE = "cdash.nersc.gov"
# custom setup.py command (runs CMake)
pyctest.CONFIGURE_COMMAND = "python setup.py configure"
# build and install
pyctest.BUILD_COMMAND = "python setup.py install"
# basic example test
examples_dir = os.path.join(pyctest.SOURCE_DIRECTORY, "examples")
basic_dir = os.path.join(examples_dir, "Basic")
pyctest.test(
name="basic",
cmd=["python", "basic.py", "--", "-VV"],
properties={"WORKING_DIRECTORY": basic_dir},
)
# tomopy example test
tomopy_dir = os.path.join(examples_dir, "TomoPy")
pyctest.test(
name="tomopy",
cmd=[
"python",
"pyctest_tomopy.py",
"--pyctest-stages",
"Start",
"Configure",
"Build",
"--",
"-VV",
],
properties={"WORKING_DIRECTORY": tomopy_dir},
)
# run stages
pyctest.run()
# -------------------------------------------------------------------------------------- #
if __name__ == "__main__":
try:
run_pyctest()
except Exception as e:
print("Error running pyctest - {}".format(e))
exc_type, exc_value, exc_trback = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_trback, limit=10)
sys.exit(1)
sys.exit(0)