From 303af6b66922f534c4467a57d3864d0a940d23af Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Sat, 5 Oct 2019 21:03:40 +0300 Subject: [PATCH] Generate log file --- test/run-spec-test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/run-spec-test.py b/test/run-spec-test.py index 53785fa..a94a00e 100755 --- a/test/run-spec-test.py +++ b/test/run-spec-test.py @@ -17,6 +17,9 @@ from pprint import pprint # Utilities # +log = open("spec-test.log","w+") +log.write("======================\n") + class ansi: ENDC = '\033[0m' HEADER = '\033[94m' @@ -42,6 +45,7 @@ class dotdict(dict): __delattr__ = dict.__delitem__ def warning(msg): + log.write("Warning: " + msg + "\n") print(f"{ansi.WARNING}Warning:{ansi.ENDC} {msg}") def run(cmd): @@ -187,12 +191,15 @@ def runInvoke(test): print(f"Log:") print(output) + log.write(f"{test.source}\t|\t{filename(cmd[1])} {cmd[2]}({', '.join(cmd[3:])})\t=>\t\t") if actual == expect: stats.success += 1 + log.write(f"OK: {actual}\n") if args.test: showTestResult() else: stats.failed += 1 + log.write(f"FAIL: {actual}, should be: {expect}\n") if args.silent: return if args.skip_crashes and actual == "": return