From e19374f9fb296d38282a59e0c01f8dd8a4c83b26 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 6 Jan 2020 10:17:41 +0100 Subject: [PATCH] Separate errors by newline and ident next line --- easybuild/tools/run.py | 6 +++--- test/framework/run.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/easybuild/tools/run.py b/easybuild/tools/run.py index 5c8ea09429..da6960f92b 100644 --- a/easybuild/tools/run.py +++ b/easybuild/tools/run.py @@ -539,7 +539,7 @@ def parse_cmd_output(cmd, stdouterr, ec, simple, log_all, log_ok, regexp): if use_regexp or regexp: res = parse_log_for_error(stdouterr, regexp, msg="Command used: %s" % cmd) if len(res) > 0: - message = "Found %s errors in command output (output: %s)" % (len(res), ", ".join([r[0] for r in res])) + message = "Found %s errors in command output (output: %s)" % (len(res), "\n\t".join([r[0] for r in res])) if use_regexp: raise EasyBuildError(message) else: @@ -643,7 +643,7 @@ def check_log_for_errors(log_txt, reg_exps): errors_found_in_log += len(warnings) + len(errors) if warnings: _log.warning("Found %s potential error(s) in command output (output: %s)", - len(warnings), ", ".join(warnings)) + len(warnings), "\n\t".join(warnings)) if errors: raise EasyBuildError("Found %s error(s) in command output (output: %s)", - len(errors), ", ".join(errors)) + len(errors), "\n\t".join(errors)) diff --git a/test/framework/run.py b/test/framework/run.py index 4f19b90273..89c4525d95 100644 --- a/test/framework/run.py +++ b/test/framework/run.py @@ -538,7 +538,7 @@ def test_check_log_for_errors(self): "enabling -Werror", "the process crashed with 0" ]) - expected_error_msg = r"Found 2 error\(s\) in command output \(output: error found, the process crashed with 0\)" + expected_error_msg = r"Found 2 error\(s\) in command output \(output: error found\n\tthe process crashed with 0\)" # String promoted to list self.assertErrorRegex(EasyBuildError, expected_error_msg, check_log_for_errors, input_text, @@ -551,13 +551,13 @@ def test_check_log_for_errors(self): [(r"\b(error|crashed)\b", ERROR)]) expected_error_msg = "Found 2 potential error(s) in command output " \ - "(output: error found, the process crashed with 0)" + "(output: error found\n\tthe process crashed with 0)" init_logging(logfile, silent=True) check_log_for_errors(input_text, [(r"\b(error|crashed)\b", WARN)]) stop_logging(logfile) self.assertTrue(expected_error_msg in read_file(logfile)) - expected_error_msg = r"Found 2 error\(s\) in command output \(output: error found, test failed\)" + expected_error_msg = r"Found 2 error\(s\) in command output \(output: error found\n\ttest failed\)" write_file(logfile, '') init_logging(logfile, silent=True) self.assertErrorRegex(EasyBuildError, expected_error_msg, check_log_for_errors, input_text, [