From 05e7aedd95718c9c1863ca1000045fc932cd9ad5 Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Tue, 10 Jul 2018 11:29:25 +0200 Subject: [PATCH] prism-auto: tweak exit code handling in --verbose-test mode If --verbose-test is on, we want to also count failure exit codes from the PRISM calls as failures. --- prism/etc/scripts/prism-auto | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/prism/etc/scripts/prism-auto b/prism/etc/scripts/prism-auto index f843143b..17ee2d7f 100755 --- a/prism/etc/scripts/prism-auto +++ b/prism/etc/scripts/prism-auto @@ -557,20 +557,21 @@ 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()) sys.stdout.flush() - if options.test and not options.verboseTest and exitCode != 0: - # failure, 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) + if options.test and exitCode != 0: + # failure + if not options.verboseTest: + # we don't want to cleanup the log (if it was a temporary file) + # so that the user can inspect it + cleanupLogFile = False + print("To see log file, run:") + print("edit " + logFile) if not options.testAll: closeDown(1) if cleanupLogFile: