summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/issue_verification/Makefile4
-rw-r--r--lldb/packages/Python/lldbsuite/test/issue_verification/TestRerunInline.py.park13
-rw-r--r--lldb/packages/Python/lldbsuite/test/issue_verification/inline_rerun_inferior.cpp14
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbinline.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/result_formatter.py9
5 files changed, 42 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/issue_verification/Makefile b/lldb/packages/Python/lldbsuite/test/issue_verification/Makefile
new file mode 100644
index 00000000000..e7bd3f4dd79
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/issue_verification/Makefile
@@ -0,0 +1,4 @@
+LEVEL = ../make
+CXX_SOURCES := inline_rerun_inferior.cpp
+CXXFLAGS += -std=c++11
+include $(LEVEL)/Makefile.rules
diff --git a/lldb/packages/Python/lldbsuite/test/issue_verification/TestRerunInline.py.park b/lldb/packages/Python/lldbsuite/test/issue_verification/TestRerunInline.py.park
new file mode 100644
index 00000000000..4c50495a2ec
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/issue_verification/TestRerunInline.py.park
@@ -0,0 +1,13 @@
+"""Tests that the rerun mechanism respects lldbinline-created tests.
+
+The current implementation of this test is expected to fail both on
+the initial run and on the rerun, assuming --rerun-all-issues is provided
+to the dotest.py run.
+
+This test could be improved by doing something in the test inferior
+C++ program that could look for the "should an issue be raised" marker
+file, and then really pass on the rerun.
+"""
+import lldbsuite.test.lldbinline as lldbinline
+
+lldbinline.MakeInlineTest(__file__, globals())
diff --git a/lldb/packages/Python/lldbsuite/test/issue_verification/inline_rerun_inferior.cpp b/lldb/packages/Python/lldbsuite/test/issue_verification/inline_rerun_inferior.cpp
new file mode 100644
index 00000000000..933911f7b28
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/issue_verification/inline_rerun_inferior.cpp
@@ -0,0 +1,14 @@
+//===-- main.cpp --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+typedef int Foo;
+
+int main() {
+ Foo array[3] = {1,2,3};
+ return 0; //% self.expect("frame variable array --show-types --", substrs = ['(Foo [3]) wrong_type_here = {','(Foo) [0] = 1','(Foo) [1] = 2','(Foo) [2] = 3'])
+}
diff --git a/lldb/packages/Python/lldbsuite/test/lldbinline.py b/lldb/packages/Python/lldbsuite/test/lldbinline.py
index 67a5e817970..691a3fba6dc 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbinline.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbinline.py
@@ -203,6 +203,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
+ test.test_filename = __file
return test
diff --git a/lldb/packages/Python/lldbsuite/test/result_formatter.py b/lldb/packages/Python/lldbsuite/test/result_formatter.py
index 35b3617e1c8..44474918895 100644
--- a/lldb/packages/Python/lldbsuite/test/result_formatter.py
+++ b/lldb/packages/Python/lldbsuite/test/result_formatter.py
@@ -242,11 +242,18 @@ class EventBuilder(object):
"""
test_class_name, test_name = EventBuilder._get_test_name_info(test)
+ # Determine the filename for the test case. If there is an attribute
+ # for it, use it. Otherwise, determine from the TestCase class path.
+ if hasattr(test, "test_filename"):
+ test_filename = test.test_filename
+ else:
+ test_filename = inspect.getfile(test.__class__)
+
event = EventBuilder.bare_event(event_type)
event.update({
"test_class": test_class_name,
"test_name": test_name,
- "test_filename": inspect.getfile(test.__class__)
+ "test_filename": test_filename
})
return event
OpenPOWER on IntegriCloud