blob: 1522631de4b1c3403cabc10fec5a451c1063b253 (
plain)
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
|
#!/usr/bin/env python3
#
# "make test" for all platforms, running automated tests.
import argparse
import os
import shutil
import sys
from make_utils import call
# Parse arguments
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--ctest-command", default="ctest")
parser.add_argument("build_directory")
return parser.parse_args()
args = parse_arguments()
ctest_command = args.ctest_command
build_dir = args.build_directory
if shutil.which(ctest_command) is None:
sys.stderr.write("ctest not found, can't run tests\n")
sys.exit(1)
# Run tests
os.chdir(build_dir)
call([ctest_command, ".", "--output-on-failure"])
|