From 8ff5d56c2031b2075f61c5906e5e4716e8c4f76e Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Fri, 29 Oct 2010 22:20:36 +0000 Subject: [PATCH] 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. llvm-svn: 117726 --- lldb/test/dotest.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py index 21161e508717..ec38e4b13e7b 100755 --- a/lldb/test/dotest.py +++ b/lldb/test/dotest.py @@ -80,6 +80,9 @@ rdir = None # 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 @@ if not sdir_name: 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 @@ for ia in range(len(archs) if iterArchs else 1): 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 @@ for ia in range(len(archs) if iterArchs else 1): 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):