diff --git a/.gitignore b/.gitignore index 6084dfc..6c03468 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ bin/ .build-all.db +uf50-218 + +uf100-430 diff --git a/.test.db b/.test.db deleted file mode 100644 index 0460bfc..0000000 Binary files a/.test.db and /dev/null differ diff --git a/test.py b/test.py index 2836195..e7c5360 100755 --- a/test.py +++ b/test.py @@ -17,21 +17,22 @@ args = parser.parse_args(sys.argv[1:]); try: with open(".test.db", "rb") as stream: - ftimes = pickle.load(stream); + failtimes, runtimes = pickle.load(stream); except: - ftimes = dict(); + failtimes = dict(); + runtimes = dict(); -def write_ftimes(): +def write_failtimes(): with open(".test.db", "wb") as stream: - pickle.dump(ftimes, stream); + pickle.dump((failtimes, runtimes), stream); -atexit.register(write_ftimes); +atexit.register(write_failtimes); all_tests = list(glob.glob("tests/**/*.cnf", recursive = True)); for test in all_tests: - if test not in ftimes: - ftimes[test] = time.time(); + if test not in failtimes: + failtimes[test] = time.time(); def printgreen(text): if args.color: @@ -41,17 +42,26 @@ def printgreen(text): n = len(all_tests); -for i, test in enumerate(sorted(all_tests, key = lambda x: -ftimes[x])): - command = [args.executable, "-i", test, "-vV"]; +for i, test in enumerate(sorted(all_tests, key = lambda x: -failtimes[x])): + command = [args.executable, "-i", test, "-V"]; + + # if we don't know how long this test will take, or if we know that it will + # take a long time (more than 5 seconds): add the verbose option. + if test not in runtimes or runtimes[test] > 10: + command += ['-v']; prettycommand = f"[{i}/{n}]: {test} ..."; printgreen(prettycommand); + before = time.time(); res = subprocess.run(command); + after = time.time(); + + runtimes[test] = after - before; if res.returncode: - ftimes[test] = time.time(); + failtimes[test] = time.time(); exit(1); printgreen("All tests pass!"); diff --git a/tests/satlib/.gitignore b/tests/satlib/.gitignore deleted file mode 100644 index 48b5770..0000000 --- a/tests/satlib/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -uf100-430/ -