forked from kokkos/pykokkos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruntests.py
More file actions
30 lines (24 loc) · 673 Bytes
/
runtests.py
File metadata and controls
30 lines (24 loc) · 673 Bytes
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
import sys
import argparse
import os
import shutil
import pytest
# purge pk_cpp folder so that the
# test suite actually translates and
# compiles the code under test
cwd = os.getcwd()
shutil.rmtree(os.path.join(cwd, "pk_cpp"),
ignore_errors=True)
# try to support command line arguments to
# runtests.py that mirror direct usage of
# pytest
pytest_args = []
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--specifictests', type=str)
args = parser.parse_args()
if args.specifictests:
pytest_args.append(args.specifictests)
# force pytest to actually import
# all the test modules directly
ret = pytest.main(pytest_args)
sys.exit(ret)