aboutsummaryrefslogtreecommitdiff
path: root/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py')
-rw-r--r--polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py46
1 files changed, 27 insertions, 19 deletions
diff --git a/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py b/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py
index 35ac598..3677acb 100644
--- a/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py
+++ b/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py
@@ -36,15 +36,17 @@ def run_tests(test_file, options):
if options.skip > 0 and line < options.skip:
continue
name, args = test.split("|")
- if options.verbose or (options.progress > 0
- and line % options.progress == 0):
+ if options.verbose or (options.progress > 0 and line % options.progress == 0):
print("TEST: {}@{}".format(line, test), end="")
api = gmpapi.get_api(name)
wrapper = wrappers.get_wrapper(name)
input_args = args.split(",")
if len(api.params) != len(input_args):
- raise RuntimeError("Mismatch in args length: {} != {}".format(
- len(api.params), len(input_args)))
+ raise RuntimeError(
+ "Mismatch in args length: {} != {}".format(
+ len(api.params), len(input_args)
+ )
+ )
call_args = []
for i in range(len(api.params)):
@@ -72,8 +74,9 @@ def run_tests(test_file, options):
else:
raise RuntimeError("Unknown param type: {}".format(param))
- res = wrappers.run_test(wrapper, line, name, gmp_test_so,
- imath_test_so, *call_args)
+ res = wrappers.run_test(
+ wrapper, line, name, gmp_test_so, imath_test_so, *call_args
+ )
if not res:
failures += 1
print_failure(line, test)
@@ -90,27 +93,26 @@ def parse_args():
"--fork",
help="fork() before each operation",
action="store_true",
- default=False)
+ default=False,
+ )
parser.add_option(
"-v",
"--verbose",
help="print PASS and FAIL tests",
action="store_true",
- default=False)
+ default=False,
+ )
parser.add_option(
"-p",
"--progress",
help="print progress every N tests ",
metavar="N",
type="int",
- default=0)
+ default=0,
+ )
parser.add_option(
- "-s",
- "--skip",
- help="skip to test N",
- metavar="N",
- type="int",
- default=0)
+ "-s", "--skip", help="skip to test N", metavar="N", type="int", default=0
+ )
return parser.parse_args()
@@ -128,16 +130,22 @@ if __name__ == "__main__":
for test_file in tests:
print("Running tests in {}".format(test_file))
(passes, failures, fail_lines) = run_tests(test_file, options)
- print(" Tests: {}. Passes: {}. Failures: {}.".format(
- passes + failures, passes, failures))
+ print(
+ " Tests: {}. Passes: {}. Failures: {}.".format(
+ passes + failures, passes, failures
+ )
+ )
total_pass += passes
total_fail += failures
all_fail_lines += fail_lines
print("=" * 70)
print("Total")
- print(" Tests: {}. Passes: {}. Failures: {}.".format(
- total_pass + total_fail, total_pass, total_fail))
+ print(
+ " Tests: {}. Passes: {}. Failures: {}.".format(
+ total_pass + total_fail, total_pass, total_fail
+ )
+ )
if len(all_fail_lines) > 0:
print("Failing Tests:")
for (line, test) in all_fail_lines: