[Lldb-commits] [lldb] r117726 - /lldb/trunk/test/dotest.py

Johnny Chen johnny.chen at apple.com
Fri Oct 29 15:20:36 PDT 2010


Author: johnny
Date: Fri Oct 29 17:20:36 2010
New Revision: 117726

URL: http://llvm.org/viewvc/llvm-project?rev=117726&view=rev
Log:
The informational message for where to find the session logs for failed/errored
tests should be near the test summary message, instead of way up in the beginning.

Modified:
    lldb/trunk/test/dotest.py

Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=117726&r1=117725&r2=117726&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Fri Oct 29 17:20:36 2010
@@ -80,6 +80,9 @@
 # run.  Use '-s session-dir-name' to specify a specific dir name.
 sdir_name = None
 
+# Set this flag if there is any session info dumped during the test run.
+sdir_has_content = False
+
 # Default verbosity is 0.
 verbose = 0
 
@@ -568,7 +571,6 @@
     timestamp = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S")
     sdir_name = timestamp
 os.environ["LLDB_SESSION_DIRNAME"] = sdir_name
-sys.stderr.write("\nSession info for test failures/errors will go into directory '%s'\n" % sdir_name)
 
 #
 # Invoke the default TextTestRunner to run the test suite, possibly iterating
@@ -680,12 +682,16 @@
                 lldb.test_result = self
 
             def addError(self, test, err):
+                global sdir_has_content
+                sdir_has_content = True
                 super(LLDBTestResult, self).addError(test, err)
                 method = getattr(test, "markError", None)
                 if method:
                     method()
 
             def addFailure(self, test, err):
+                global sdir_has_content
+                sdir_has_content = True
                 super(LLDBTestResult, self).addFailure(test, err)
                 method = getattr(test, "markFailure", None)
                 if method:
@@ -695,6 +701,9 @@
                                           resultclass=LLDBTestResult).run(suite)
         
 
+if sdir_has_content:
+    sys.stderr.write("\nSession logs for test failures/errors can be found in directory '%s'\n" % sdir_name)
+
 # Terminate the test suite if ${LLDB_TESTSUITE_FORCE_FINISH} is defined.
 # This should not be necessary now.
 if ("LLDB_TESTSUITE_FORCE_FINISH" in os.environ):





More information about the lldb-commits mailing list