From 1e6cda1d2792c4ff46e083b7d22e0ca99d687a9e Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Tue, 20 Mar 2012 14:22:05 +0000 Subject: [PATCH] Test mode for prism-auto prints errors if they occur. git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@4905 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/etc/scripts/prism-auto | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/prism/etc/scripts/prism-auto b/prism/etc/scripts/prism-auto index 5fb9b9ba..842ba109 100755 --- a/prism/etc/scripts/prism-auto +++ b/prism/etc/scripts/prism-auto @@ -213,7 +213,7 @@ def runPrism(args): exitCode = subprocess.Popen(prismArgs, stdout=f).wait() #exitCode = subprocess.Popen(prismArgs, cwd=dir, stdout=f).wait() elif options.test: - f = tempfile.NamedTemporaryFile() + f = tempfile.NamedTemporaryFile(delete=False) logFile = f.name exitCode = subprocess.Popen(prismArgs, stdout=f).wait() else: @@ -221,9 +221,12 @@ def runPrism(args): # Extract test results if needed if options.test: for line in open(logFile, 'r').readlines(): - if re.match('Testing result', line): + if re.match('Testing result:', line): print line, if options.test and exitCode != 0: + for line in open(logFile, 'r').readlines(): + if re.match('Error:', line): + print line, print "Log file: " + logFile sys.exit(1)