[Lldb-commits] [lldb] r266192 - Fix test rerun logic

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 13 05:05:50 PDT 2016

Author: labath
Date: Wed Apr 13 07:05:48 2016
New Revision: 266192

URL: http://llvm.org/viewvc/llvm-project?rev=266192&view=rev
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.


Modified: lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py?rev=266192&r1=266191&r2=266192&view=diff
--- lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/result_formatter.py Wed Apr 13 07:05:48 2016
@@ -247,7 +247,7 @@ class EventBuilder(object):
         if hasattr(test, "test_filename"):
             test_filename = test.test_filename
-            test_filename = inspect.getfile(test.__class__)
+            test_filename = inspect.getsourcefile(test.__class__)
         event = EventBuilder.bare_event(event_type)

More information about the lldb-commits mailing list