Skip to content

Commit

Permalink
Add redo test command logging to redo test_all
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dinkelk committed Sep 13, 2024
1 parent 934db8b commit 917cd68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion redo/rules/build_test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 917cd68

Please sign in to comment.