Add a script to the karatsuba tests

signals
Gavin Howard 3 years ago
parent c104091287
commit bc332b8052
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 16
      karatsuba.py

@ -81,6 +81,7 @@ for i in range(0, nruns):
runs.append(0)
tests = [ "multiply", "modulus", "power", "sqrt" ]
scripts = [ "multiply" ]
if test_num != 0:
mx2 = test_num
@ -123,6 +124,21 @@ try:
print("")
for script in scripts:
cmd = [ "{}/tests/script.sh".format(testdir), "bc", script + ".bc",
"0", "1", "0", exe ]
p = subprocess.run(cmd + sys.argv[3:], stderr=subprocess.PIPE)
if p.returncode != 0:
print("{} test failed:\n".format(test, p.returncode))
print(p.stderr.decode())
print("\nexiting...")
sys.exit(p.returncode)
print("")
elif test_num == 0:
print("Timing Karatsuba Num: {}".format(i), end='', flush=True)

Loading…
Cancel
Save