summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lldbinline.py
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2016-04-18 20:26:56 +0000
committerTodd Fiala <todd.fiala@gmail.com>2016-04-18 20:26:56 +0000
commitdad52cee4b85a058c8140649e46a02f6d95ba4d1 (patch)
tree4d05895c7fd22b4113958503735fb6adc7a1f8b0 /lldb/packages/Python/lldbsuite/test/lldbinline.py
parent3fde652e1864f0e4273352c185cd14f80afbe064 (diff)
downloadbcm5719-llvm-dad52cee4b85a058c8140649e46a02f6d95ba4d1.tar.gz
bcm5719-llvm-dad52cee4b85a058c8140649e46a02f6d95ba4d1.zip
ensure lldbinline remembers .py extension
This ensure lldbinline.test_file paths are tracked as .py files rather than .pyc files. Also, this change adds an assert to the test infrastructure if a filename that is not ending in .py is attempted to be added to the test events infrastructure where we track test results. See: http://reviews.llvm.org/D19215 Earlier revision reviewed by: Pavel Labath llvm-svn: 266664
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbinline.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbinline.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbinline.py b/lldb/packages/Python/lldbsuite/test/lldbinline.py
index 4eaa2a7583d..ac2e2573c1a 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbinline.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbinline.py
@@ -189,6 +189,12 @@ def ApplyDecoratorsToFunction(func, decorators):
def MakeInlineTest(__file, __globals, decorators=None):
+ # Adjust the filename if it ends in .pyc. We want filenames to
+ # reflect the source python file, not the compiled variant.
+ if __file is not None and __file.endswith(".pyc"):
+ # Strip the trailing "c"
+ __file = __file[0:-1]
+
# Derive the test name from the current file name
file_basename = os.path.basename(__file)
InlineTest.mydir = TestBase.compute_mydir(__file)
@@ -205,7 +211,8 @@ def MakeInlineTest(__file, __globals, decorators=None):
# Add the test case to the globals, and hide InlineTest
__globals.update({test_name : test})
- # Store the name of the originating file.o
+ # Keep track of the original test filename so we report it
+ # correctly in test results.
test.test_filename = __file
return test
OpenPOWER on IntegriCloud