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.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118315 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/lldbtest.py b/test/lldbtest.py
index 2cefb81..7f1428e 100644
--- a/test/lldbtest.py
+++ b/test/lldbtest.py
@@ -544,10 +544,13 @@
# 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 @@
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()