Skip to content

Commit

Permalink
Add logging for XTIMEOUT/UnexpectedSuccess
Browse files Browse the repository at this point in the history
If an expected timeout test times out, touch
<session-dir>/ExpectedTimeout-<test-name>

If an expected timeout test passes, touch
<session-dir>/UnexpectedCompletion-<test-name>

Differential Revision: http://reviews.llvm.org/D9843

llvm-svn: 237925
  • Loading branch information
vharron committed May 21, 2015
1 parent 41657cc commit 0b9dbb5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lldb/test/dosep.py
Expand Up @@ -190,6 +190,10 @@ def getExpectedTimeouts(platform_name):
}
return expected_timeout

def touch(fname, times=None):
with open(fname, 'a'):
os.utime(fname, times)

def main():
# We can't use sys.path[0] to determine the script directory
# because it doesn't work under a debugger
Expand Down Expand Up @@ -238,6 +242,9 @@ def main():
timestamp_started = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S")
dotest_argv.append('-s')
dotest_argv.append(timestamp_started)
dotest_options.s = timestamp_started

session_dir = os.path.join(os.getcwd(), dotest_options.s)

# The root directory was specified on the command line
if len(args) == 0:
Expand Down Expand Up @@ -268,6 +275,15 @@ def main():
if xtime in timed_out:
timed_out.remove(xtime)
failed.remove(xtime)
result = "ExpectedTimeout"
elif xtime in passed:
result = "UnexpectedCompletion"
else:
result = None # failed

if result:
test_name = os.path.splitext(xtime)[0]
touch(os.path.join(session_dir, "{}-{}".format(result, test_name)))

print "Ran %d tests." % num_tests
if len(failed) > 0:
Expand Down

0 comments on commit 0b9dbb5

Please sign in to comment.