Skip to content

Commit

Permalink
fixed algebraic number tests and added return code on failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hader committed Nov 3, 2023
1 parent 03d10ea commit ff275af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions test/python/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def forkexec(test, env):


def main():

parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('--sympy', action="store_true")
parser.add_argument('--stats', action="store_true")
Expand All @@ -36,27 +35,29 @@ def main():
"tests/polynomial_feasibility.py",
"tests/value.py"]

if (args.sympy):
if args.sympy:
print("Sympy checking enabled")
polypy_test.sympy_checker.enabled = True
else:
print("Sympy checking disabled")
polypy_test.sympy_checker.enabled = False



failed = 0
for test in tests:
print("Running {0}:".format(test))
context = dict()
forkexec(test, context)
module = context["polypy_test"]
print("PASS: {0}".format(module.PASS))
print("FAIL: {0}".format(module.FAIL))
failed += module.FAIL

if (args.stats):
if args.stats:
print("Statistics:")
polypy.stats_print()

return 1 if failed > 0 else 0


if __name__ == '__main__':
sys.exit(main())
2 changes: 1 addition & 1 deletion test/python/tests/algebraic_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ def check_comparison(a1, a2, cmp, result, expected):
p = functools.reduce(lambda x, y: x*y, sample, one)
random.shuffle(sample)
p = functools.reduce(lambda x, y: x/y, sample, p)
polypy_test.check(p == 1)
polypy_test.check(p == one)

0 comments on commit ff275af

Please sign in to comment.