Browse Source

Colour code test results from prism-auto script.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10251 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 11 years ago
parent
commit
8aa9d24f5d
  1. 3
      prism/CHANGELOG.txt
  2. 30
      prism/etc/scripts/prism-auto

3
prism/CHANGELOG.txt

@ -5,10 +5,11 @@ Version 4.3 (first released ???)
-----------------------------------------------------------------------------
* Support for external LTL-to-automata converters via the HOA format
- including model checking for Generalised Rabin (GR) and generic acceptance conditions
* New model checking functionality/optimisations
- lower time-bounds for properties of DTMCs/MDPs (e.g. P=? [ F>=2 "target" ])
- expected total rewards (R[C]) implemented for DTMCs in symbolic engine
- expected total rewards (R[C]) implemented for DTMCs
- backwards reachability algorithm implemented for model checking PTAs
- exact (arbitrary precision) model checking via the parametric engine (experimental)
- various LTL model checking optimisations

30
prism/etc/scripts/prism-auto

@ -334,16 +334,29 @@ def runPrism(args, dir=""):
if options.test:
for line in open(logFile, 'r').readlines():
if re.match('Testing result:', line):
print line,
printTestResult(line)
if options.test and exitCode != 0:
for line in open(logFile, 'r').readlines():
if re.match('Error:', line):
print line,
printTestResult(line)
print "To see log file, run:"
print "edit " + logFile
if not options.testAll:
sys.exit(1)
def printTestResult(msg):
msg = str.rstrip(msg)
if 'Error:' in msg or 'FAIL' in msg:
print '\033[31m' + msg + '\033[0m'
elif 'PASS' in msg:
print '\033[32m' + msg + '\033[0m'
elif 'SKIPPED' in msg:
print '\033[90m' + msg + '\033[0m'
elif 'UNSUPPORTED' in msg:
print '\033[33m' + msg + '\033[0m'
else:
print msg
# Checks for each file from the outFiles list whether there is an identical file
# with the name exportPrefix + file. If so, said file is deleted. Otherwise, it is kept
# Returns true iff identical files were found for each out file
@ -352,27 +365,28 @@ def verifyAndCleanupExports(outFiles, exportPrefix):
result = True
# Check for equality with out files
for outFile in outFiles:
print "Testing export " + os.path.basename(outFile) + ":",
msg = "Testing export " + os.path.basename(outFile) + ": "
expFile = prependToFile(exportPrefix, outFile)
if os.path.isfile(expFile):
if options.noExportTests:
print "SKIPPED"
msg = msg + "SKIPPED"
os.remove(expFile)
elif filecmp.cmp(outFile, expFile):
# If successful, notify and delete exported file
print "PASS"
msg = msg + "PASS"
os.remove(expFile)
else:
print "FAIL (" + os.path.basename(expFile) + " does not match)"
msg = msg + "FAIL (" + os.path.basename(expFile) + " does not match)"
print "To see difference, run:"
print "diff " + outFile + " " + expFile
result = False
else:
if options.noExportTests:
print "SKIPPED"
msg = msg + "SKIPPED"
else:
print "FAIL (no " + os.path.basename(expFile) + " to compare to)"
msg = msg + "FAIL (no " + os.path.basename(expFile) + " to compare to)"
result = False
printTestResult(msg)
return result
# Run a benchmark, specified by a list of command-line args,

Loading…
Cancel
Save