From 1e39f308f46e560e45fe06413bf3262d2aa77a61 Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Fri, 18 Aug 2017 18:21:11 +0200 Subject: [PATCH] prism-auto: count warnings, even if -w / --show-warnings is not active --- prism/etc/scripts/prism-auto | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/prism/etc/scripts/prism-auto b/prism/etc/scripts/prism-auto index 9c202ecc..b3c400b4 100755 --- a/prism/etc/scripts/prism-auto +++ b/prism/etc/scripts/prism-auto @@ -417,8 +417,12 @@ def runPrism(args, dir=""): for line in open(logFile, 'r').readlines(): if re.match('Testing result:', line): printTestResult(line) - elif options.showWarnings and re.match('Warning:', line): - printTestResult(line) + elif re.match('Warning:', line): + if options.showWarnings: + printTestResult(line) + else: + # We don't print it, but we count it + countTestResult(line) elif options.verboseTest: # in verbose mode, also print the non-matching lines # rstrip to remove newline before printing @@ -469,7 +473,8 @@ def printTestStatistics(): if options.test and not options.echo: print('\nTest results:') printColoured('SUCCESS', ' Success: ' + str(testStats['SUCCESS'])) - printColoured('WARNING', ' Warnings: ' + str(testStats['WARNING'])) + printColoured('WARNING', ' Warnings: ' + str(testStats['WARNING']) + + (' (use -w to show)' if (testStats['WARNING']>0 and not options.showWarnings and not options.verboseTest) else '')) if (options.ddWarnings): printColoured('WARNING', ' DD-Warnings: ' + str(testStats['DDWARNING'])) printColoured('FAILURE', ' Failure: ' + str(testStats['FAILURE']))