Skip to content

Commit e19374f

Browse files
committed
Separate errors by newline and ident next line
1 parent 322d512 commit e19374f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

easybuild/tools/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def parse_cmd_output(cmd, stdouterr, ec, simple, log_all, log_ok, regexp):
539539
if use_regexp or regexp:
540540
res = parse_log_for_error(stdouterr, regexp, msg="Command used: %s" % cmd)
541541
if len(res) > 0:
542-
message = "Found %s errors in command output (output: %s)" % (len(res), ", ".join([r[0] for r in res]))
542+
message = "Found %s errors in command output (output: %s)" % (len(res), "\n\t".join([r[0] for r in res]))
543543
if use_regexp:
544544
raise EasyBuildError(message)
545545
else:
@@ -643,7 +643,7 @@ def check_log_for_errors(log_txt, reg_exps):
643643
errors_found_in_log += len(warnings) + len(errors)
644644
if warnings:
645645
_log.warning("Found %s potential error(s) in command output (output: %s)",
646-
len(warnings), ", ".join(warnings))
646+
len(warnings), "\n\t".join(warnings))
647647
if errors:
648648
raise EasyBuildError("Found %s error(s) in command output (output: %s)",
649-
len(errors), ", ".join(errors))
649+
len(errors), "\n\t".join(errors))

test/framework/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def test_check_log_for_errors(self):
538538
"enabling -Werror",
539539
"the process crashed with 0"
540540
])
541-
expected_error_msg = r"Found 2 error\(s\) in command output \(output: error found, the process crashed with 0\)"
541+
expected_error_msg = r"Found 2 error\(s\) in command output \(output: error found\n\tthe process crashed with 0\)"
542542

543543
# String promoted to list
544544
self.assertErrorRegex(EasyBuildError, expected_error_msg, check_log_for_errors, input_text,
@@ -551,13 +551,13 @@ def test_check_log_for_errors(self):
551551
[(r"\b(error|crashed)\b", ERROR)])
552552

553553
expected_error_msg = "Found 2 potential error(s) in command output " \
554-
"(output: error found, the process crashed with 0)"
554+
"(output: error found\n\tthe process crashed with 0)"
555555
init_logging(logfile, silent=True)
556556
check_log_for_errors(input_text, [(r"\b(error|crashed)\b", WARN)])
557557
stop_logging(logfile)
558558
self.assertTrue(expected_error_msg in read_file(logfile))
559559

560-
expected_error_msg = r"Found 2 error\(s\) in command output \(output: error found, test failed\)"
560+
expected_error_msg = r"Found 2 error\(s\) in command output \(output: error found\n\ttest failed\)"
561561
write_file(logfile, '')
562562
init_logging(logfile, silent=True)
563563
self.assertErrorRegex(EasyBuildError, expected_error_msg, check_log_for_errors, input_text, [

0 commit comments

Comments
 (0)