summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-04-13 12:05:48 +0000
committerPavel Labath <labath@google.com>2016-04-13 12:05:48 +0000
commit9fb77fcfef393a3a481d2fc534b76ee22531798f (patch)
treef2fd1dfc9c74afbedab9098fa89e50f55015cf45 /lldb/packages/Python/lldbsuite/test
parent855d97e30caedfa0dea3adf8928f71b16dd8a907 (diff)
downloadbcm5719-llvm-9fb77fcfef393a3a481d2fc534b76ee22531798f.tar.gz
bcm5719-llvm-9fb77fcfef393a3a481d2fc534b76ee22531798f.zip
Fix test rerun logic
result_formatter used inspect.getfile() to get the python file name, which returned "*.pyc" if the bytecode file was present. This resulted in files being displayed with the wrong extension, and more critically, would confuse the rerun logic because it would try to rerun the pyc file (which resulted in an empty rerun list as unittest refused to run those). Fix: use inspect.getsourcefile() instead. I am not sure why does was not an issue before. I can only assume that some system update tricked python into producing bytecode files more aggressively. llvm-svn: 266192
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/result_formatter.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/result_formatter.py b/lldb/packages/Python/lldbsuite/test/result_formatter.py
index 44474918895..070fa6c1440 100644
--- a/lldb/packages/Python/lldbsuite/test/result_formatter.py
+++ b/lldb/packages/Python/lldbsuite/test/result_formatter.py
@@ -247,7 +247,7 @@ class EventBuilder(object):
if hasattr(test, "test_filename"):
test_filename = test.test_filename
else:
- test_filename = inspect.getfile(test.__class__)
+ test_filename = inspect.getsourcefile(test.__class__)
event = EventBuilder.bare_event(event_type)
event.update({
OpenPOWER on IntegriCloud