diff --git a/pmb/helpers/frontend.py b/pmb/helpers/frontend.py index 77735cfb..e9e24370 100644 --- a/pmb/helpers/frontend.py +++ b/pmb/helpers/frontend.py @@ -541,8 +541,21 @@ def work_migrate(args): def log(args): if args.clear_log: pmb.helpers.run.user(args, ["truncate", "-s", "0", args.log]) - pmb.helpers.run.user(args, ["tail", "-n", args.lines, "-F", args.log], - output="tui") + + cmd = ["tail", "-n", args.lines, "-F"] + + # Follow the testsuite's log file too if it exists. It will be created when + # starting a test case that writes to it (git -C test grep log_testsuite). + log_testsuite = f"{args.work}/log_testsuite.txt" + if os.path.exists(log_testsuite): + cmd += [log_testsuite] + + # tail writes the last lines of the files to the terminal. Put the regular + # log at the end, so that output is visible at the bottom (where the user + # looks for an error / what's currently going on). + cmd += [args.log] + + pmb.helpers.run.user(args, cmd, output="tui") def log_distccd(args):