Catch timestamps for the beginning and end of the test suite run.

llvm-svn: 162040
This commit is contained in:
Johnny Chen 2012-08-16 19:15:21 +00:00
parent 2039a987c4
commit a60c5ad819
1 changed files with 10 additions and 5 deletions

View File

@ -1097,11 +1097,11 @@ unittest2.signals.installHandler()
# later on.
#
# See also TestBase.dumpSessionInfo() in lldbtest.py.
import datetime
# The windows platforms don't like ':' in the pathname.
timestamp_started = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S")
if not sdir_name:
import datetime
# The windows platforms don't like ':' in the pathname.
timestamp = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S")
sdir_name = timestamp
sdir_name = timestamp_started
os.environ["LLDB_SESSION_DIRNAME"] = os.path.join(os.getcwd(), sdir_name)
if not noHeaders:
@ -1111,8 +1111,9 @@ if not noHeaders:
if not os.path.isdir(sdir_name):
os.mkdir(sdir_name)
fname = os.path.join(sdir_name, "svn-info")
fname = os.path.join(sdir_name, "TestStarted")
with open(fname, "w") as f:
print >> f, "Test started at: %s\n" % timestamp_started
print >> f, svn_info
print >> f, "Command invoked: %s\n" % getMyCommandLine()
@ -1363,6 +1364,10 @@ if sdir_has_content:
sys.stderr.write("Session logs for test failures/errors/unexpected successes"
" can be found in directory '%s'\n" % sdir_name)
fname = os.path.join(sdir_name, "TestFinished")
with open(fname, "w") as f:
print >> f, "Test finished at: %s\n" % datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S")
# 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):