From 917cd68110b27d5e6b50720833ae09528c9dac82 Mon Sep 17 00:00:00 2001 From: Kevin Dinkel <1225857+dinkelk@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:34:36 -0600 Subject: [PATCH] Add `redo test` command logging to `redo test_all` This commit adds the `redo test` command output to log/test_name.log for each unit test run via `redo test_all`. This should assist in debugging tests that fail due to failed compilation. --- redo/rules/build_test_all.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/redo/rules/build_test_all.py b/redo/rules/build_test_all.py index 37f60499..b35278ac 100644 --- a/redo/rules/build_test_all.py +++ b/redo/rules/build_test_all.py @@ -71,7 +71,9 @@ def build(self, redo_1, redo_2, redo_3): # Make a build directory at the top level: failed_test_log_dir = os.path.join(directory, "build" + os.sep + "failed_test_logs") + log_dir = os.path.join(directory, "build" + os.sep + "log") filesystem.safe_makedir(failed_test_log_dir) + filesystem.safe_makedir(log_dir) # Run tests: exit_code = 0 @@ -86,7 +88,8 @@ def build(self, redo_1, redo_2, redo_3): sys.stderr.flush() database.setup.reset() try: - redo.redo([os.path.join(test, "test"), "1>&2", "2>/dev/null"]) + test_log = os.path.join(log_dir, rel_test.replace(os.sep, "_") + ".log") + redo.redo([os.path.join(test, "test"), "1>&2", "2>" + test_log]) sys.stderr.write(" " + PASSED + "\n") except BaseException: exit_code = 1