1"""
2
3If any of the automatically generated tests fail, the commands to re-run the test is logged in "error_log.txt".
4
5This script runs all the test cases that have previously failed, acting as regression test for the random tests.
6
7"""
8
9import os
10
11if __name__ == "__main__":
12  err_log = "error_log.txt"
13  ntests = 0
14  nok = 0
15
16  print("\nRunning test cases from error log (cases that failed during development).\n")
17
18  if os.path.exists(err_log):
19    tests = open(err_log).readlines()
20    tetst = [t for t in tests if t]
21    ntests = len(tests)
22    for t in tests:
23      err_code = os.system(t)
24      if err_code == 0:
25        nok += 1
26  print("%d/%d tests passed.\n" % (nok, ntests))
27
28
29