Author: gnichols
Date: 2011-01-17 20:55:55 +0000 (Mon, 17 Jan 2011)
New Revision: 713
Modified:
trunk/v7/rundocument.py
Log:
665272 - Why so many tests lost their output?
Modified: trunk/v7/rundocument.py
===================================================================
--- trunk/v7/rundocument.py 2011-01-17 20:54:47 UTC (rev 712)
+++ trunk/v7/rundocument.py 2011-01-17 20:55:55 UTC (rev 713)
@@ -169,12 +169,13 @@
textNode = self.addTextNode(outputElement, section)
def setTestOutput(self, outputFile):
+ errors = ""
try:
self.merge(outputFile, nodeIndex=0)
return True
except Exception, e:
- print "Warning: could not merge output XML, reading as text file."
- print e
+ errors = "Warning: could not merge output XML, reading as text
file.\n"
+ errors += e.message + "\n"
# parser failed, just read the file
try:
@@ -183,11 +184,20 @@
if output and len(output) > 0:
outputElement = self.findOrCreateElement(self.element, Tags.output)
textNode = self.setTextNode(outputElement, "".join(output))
- return True
+ return True
+ else:
+ errors += "Error: log file is empty or missing.\n"
except Exception, e:
- print "Error: could not read log file " + outputFile
- print e
- return False
+ errors += "Error: could not read log file " + outputFile +
"\n"
+ print e.message + "\n"
+
+ # otherwise - couldn't read log, or empty log - print them, and copy them to
run output
+ if errors:
+ print errors
+ outputElement = self.findOrCreateElement(self.element, Tags.output)
+ textNode = self.setTextNode(outputElement, errors)
+
+ return False
def getResults(self, environment, resultsFile):
try:
Show replies by date