Make the type of session log part of the filename itself. It allows for easier

identification of the test failures/errors by human beings as well as automatic
processings.

The prefix which identifies the type can be: Error, Failure, or ExpectedFailure.

llvm-svn: 118315
This commit is contained in:
Johnny Chen 2010-11-06 00:07:07 +00:00
parent 7d391557cc
commit f7f9d9d880
1 changed files with 4 additions and 1 deletions

View File

@ -544,10 +544,13 @@ class TestBase(unittest2.TestCase):
# See http://docs.python.org/library/unittest.html#unittest.TestResult.
if self.__errored__:
pairs = lldb.test_result.errors
prefix = 'Error'
elif self.__failed__:
pairs = lldb.test_result.failures
prefix = 'Failure'
elif self.__expected__:
pairs = lldb.test_result.expectedFailures
prefix = 'ExpectedFailure'
else:
# Simply return, there's no session info to dump!
return
@ -560,7 +563,7 @@ class TestBase(unittest2.TestCase):
os.environ["LLDB_SESSION_DIRNAME"])
if not os.path.isdir(dname):
os.mkdir(dname)
fname = os.path.join(dname, "%s.log" % self.id())
fname = os.path.join(dname, "%s-%s.log" % (prefix, self.id()))
with open(fname, "w") as f:
import datetime
print >> f, "Session info generated @", datetime.datetime.now().ctime()