diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-08-30 15:20:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-08-30 18:57:18 +0300 |
commit | 464e545c723616372bfeec8e955bf1177437fa32 (patch) | |
tree | 65e8b8f1b5d25ad761a364e19335940542d91690 /build_files/utils/make_test.py | |
parent | e218d8c24bfbd5384e040417e533ede96c4e831b (diff) |
Tests: move "make test" on macOS and Linux to Python script
Diffstat (limited to 'build_files/utils/make_test.py')
-rwxr-xr-x | build_files/utils/make_test.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/build_files/utils/make_test.py b/build_files/utils/make_test.py new file mode 100755 index 00000000000..1522631de4b --- /dev/null +++ b/build_files/utils/make_test.py @@ -0,0 +1,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"]) |