diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-11-21 17:04:21 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-11-21 17:09:35 +0900 |
commit | e6ba08c3b21cdb14ee3a97b5d584759a4597b54b (patch) | |
tree | e8b4121323f2f448aeaa15bf3bddb465f36aea8b /debian/uncrustify-trinity/uncrustify-trinity-0.74.0/scripts/run_ctest.py | |
parent | f312c235ea5f9971066f3808997d20f89c25f33b (diff) | |
download | extra-dependencies-e6ba08c3b21cdb14ee3a97b5d584759a4597b54b.tar.gz extra-dependencies-e6ba08c3b21cdb14ee3a97b5d584759a4597b54b.zip |
uncrustify-trinity: updated based on upstream version 0.74.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.74.0/scripts/run_ctest.py')
-rwxr-xr-x | debian/uncrustify-trinity/uncrustify-trinity-0.74.0/scripts/run_ctest.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/scripts/run_ctest.py b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/scripts/run_ctest.py new file mode 100755 index 00000000..0267e0ad --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/scripts/run_ctest.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +import argparse +import math +import os +import subprocess +import sys + +from multiprocessing import cpu_count + +default_jobs = min(cpu_count() + 2, cpu_count() * 2) + +# ----------------------------------------------------------------------------- +def main(): + parser = argparse.ArgumentParser(description='Run CTest') + parser.add_argument('-q', '--quiet', action='store_true', + help='suppress output of failing tests') + parser.add_argument('-j', '--parallel', type=int, default=default_jobs, + help='number of jobs to use for parallel execution') + parser.add_argument('args', metavar='ARGS', nargs='*', default=[], + help='additional arguments to pass to CTest') + args = parser.parse_args() + + if not os.path.exists('CTestTestfile.cmake'): + print('No test configuration file found!') + print('(Note: This script must be run from your build directory.)') + sys.exit(-1) + + cmd = ['ctest', '-j{}'.format(args.parallel)] + if not args.quiet: + cmd.append('--output-on-failure') + cmd += args.args + + try: + subprocess.check_call(cmd) + except subprocess.CalledProcessError as exc: + sys.exit(exc.returncode) + + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +if __name__ == '__main__': + main() |