From 0dc329bb15caf8cf540b20d8d270a43d10fb3598 Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Thu, 12 Jul 2018 14:39:36 +0200 Subject: [PATCH] prism-auto: partially revert 05e7aed The occurence of a line with 'Error:' does not necessarily imply a failed test result, e.g., for test cases that test against the error messages. So we revert the previous change related to the printing of 'Error' lines and tweak the handling in verbose-test mode some more. --- prism/etc/scripts/prism-auto | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/prism/etc/scripts/prism-auto b/prism/etc/scripts/prism-auto index 17ee2d7f..fdb7a7da 100755 --- a/prism/etc/scripts/prism-auto +++ b/prism/etc/scripts/prism-auto @@ -557,12 +557,14 @@ def runPrism(args, dir=""): else: # We don't print it, but we count it countTestResult(line) - elif re.match('Error:', line): - printTestResult(line) elif options.verboseTest: # in verbose mode, also print the non-matching lines # rstrip to remove newline before printing - print(line.rstrip()) + if re.match('Error:', line): + # highlight lines with error messages + printColoured('FAILURE', line.rstrip()) + else: + print(line.rstrip()) sys.stdout.flush() if options.test and exitCode != 0: # failure @@ -570,8 +572,15 @@ def runPrism(args, dir=""): # we don't want to cleanup the log (if it was a temporary file) # so that the user can inspect it cleanupLogFile = False + for line in open(logFile, 'r').readlines(): + if re.match('Error:', line): + printTestResult(line) print("To see log file, run:") print("edit " + logFile) + else: + # in verbose test mode, print extra info and increment failure counter + printColoured('FAILURE', "\n[Exit code: " + str(exitCode) + "]") + incrementTestStat('FAILURE') if not options.testAll: closeDown(1) if cleanupLogFile: