Massive test suite cleanup to stop everyone from manually having to compute "mydir" inside each test case.
This has led to many test suite failures because of copy and paste where new test cases were based off of other test cases and the "mydir" variable wasn't updated.
Now you can call your superclasses "compute_mydir()" function with "__file__" as the sole argument and the relative path will be computed for you.
llvm-svn: 196985
diff --git a/lldb/test/python_api/debugger/TestDebuggerAPI.py b/lldb/test/python_api/debugger/TestDebuggerAPI.py
index a560cbe..42dcc24 100644
--- a/lldb/test/python_api/debugger/TestDebuggerAPI.py
+++ b/lldb/test/python_api/debugger/TestDebuggerAPI.py
@@ -9,7 +9,7 @@
class DebuggerAPITestCase(TestBase):
- mydir = os.path.join("python_api", "debugger")
+ mydir = TestBase.compute_mydir(__file__)
@python_api_test
def test_debugger_api_boundary_condition(self):
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
index 6ec0350..81b853a 100644
--- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -19,7 +19,7 @@
class APIDefaultConstructorTestCase(TestBase):
- mydir = os.path.join("python_api", "default-constructor")
+ mydir = TestBase.compute_mydir(__file__)
@python_api_test
def test_SBAddress(self):
diff --git a/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py b/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
index e716545..d6d2dc6 100644
--- a/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ b/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -10,7 +10,7 @@
class DisassembleRawDataTestCase(TestBase):
- mydir = os.path.join("python_api", "disassemble-raw-data")
+ mydir = TestBase.compute_mydir(__file__)
@python_api_test
def test_disassemble_raw_data(self):
diff --git a/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py b/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
index d2e985a..4555345 100644
--- a/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
+++ b/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
@@ -10,7 +10,7 @@
class Disassemble_VST1_64(TestBase):
- mydir = os.path.join("python_api", "disassemble-raw-data")
+ mydir = TestBase.compute_mydir(__file__)
@python_api_test
def test_disassemble_invalid_vst_1_64_raw_data(self):
diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py
index a9a7edc..64e95ea 100644
--- a/lldb/test/python_api/event/TestEvents.py
+++ b/lldb/test/python_api/event/TestEvents.py
@@ -10,7 +10,7 @@
class EventAPITestCase(TestBase):
- mydir = os.path.join("python_api", "event")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/formatters/TestFormattersSBAPI.py b/lldb/test/python_api/formatters/TestFormattersSBAPI.py
index d304a17..67aa639 100644
--- a/lldb/test/python_api/formatters/TestFormattersSBAPI.py
+++ b/lldb/test/python_api/formatters/TestFormattersSBAPI.py
@@ -8,7 +8,7 @@
class SBFormattersAPITestCase(TestBase):
- mydir = os.path.join("python_api", "formatters")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/frame/TestFrames.py b/lldb/test/python_api/frame/TestFrames.py
index 6e1ba08..050c51a 100644
--- a/lldb/test/python_api/frame/TestFrames.py
+++ b/lldb/test/python_api/frame/TestFrames.py
@@ -11,7 +11,7 @@
class FrameAPITestCase(TestBase):
- mydir = os.path.join("python_api", "frame")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
index 998c3a6..f7d1517 100644
--- a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
+++ b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
@@ -10,7 +10,7 @@
class InlinedFrameAPITestCase(TestBase):
- mydir = os.path.join("python_api", "frame", "inlines")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py
index 11e6816..14ff005 100644
--- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py
+++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py
@@ -10,7 +10,7 @@
class DisasmAPITestCase(TestBase):
- mydir = os.path.join("python_api", "function_symbol")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/python_api/function_symbol/TestSymbolAPI.py
index 60d4ffb..564a60f 100644
--- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py
+++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py
@@ -10,7 +10,7 @@
class SymbolAPITestCase(TestBase):
- mydir = os.path.join("python_api", "function_symbol")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/hello_world/TestHelloWorld.py b/lldb/test/python_api/hello_world/TestHelloWorld.py
index bfaeade..088477b 100644
--- a/lldb/test/python_api/hello_world/TestHelloWorld.py
+++ b/lldb/test/python_api/hello_world/TestHelloWorld.py
@@ -8,7 +8,7 @@
class HelloWorldTestCase(TestBase):
- mydir = os.path.join("python_api", "hello_world")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/input_reader/TestInputReaderCallback.py b/lldb/test/python_api/input_reader/TestInputReaderCallback.py
index 6a37f8b..8fea844 100644
--- a/lldb/test/python_api/input_reader/TestInputReaderCallback.py
+++ b/lldb/test/python_api/input_reader/TestInputReaderCallback.py
@@ -8,7 +8,7 @@
class InputReaderCallbackCase(TestBase):
- mydir = os.path.join("python_api", "input_reader")
+ mydir = TestBase.compute_mydir(__file__)
@python_api_test
@dwarf_test
diff --git a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
index c08d038..b23c497 100644
--- a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
+++ b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -8,7 +8,7 @@
class CommandInterpreterAPICase(TestBase):
- mydir = os.path.join("python_api", "interpreter")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
index 070fe79..2b7f341 100644
--- a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
+++ b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
@@ -9,7 +9,7 @@
class FrameUtilsTestCase(TestBase):
- mydir = os.path.join("python_api", "lldbutil", "frame")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py
index 47fe165..8983252 100644
--- a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py
+++ b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py
@@ -10,7 +10,7 @@
class LLDBIteratorTestCase(TestBase):
- mydir = os.path.join("python_api", "lldbutil", "iter")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
index 9b07625..2f6de65 100644
--- a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
+++ b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -10,7 +10,7 @@
class RegistersIteratorTestCase(TestBase):
- mydir = os.path.join("python_api", "lldbutil", "iter")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
index bb1d303..d845c790 100644
--- a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
+++ b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
@@ -10,7 +10,7 @@
class ThreadsStackTracesTestCase(TestBase):
- mydir = "python_api/lldbutil/process"
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/module_section/TestModuleAndSection.py b/lldb/test/python_api/module_section/TestModuleAndSection.py
index 7038d6e..44a242d 100644
--- a/lldb/test/python_api/module_section/TestModuleAndSection.py
+++ b/lldb/test/python_api/module_section/TestModuleAndSection.py
@@ -11,7 +11,7 @@
class ModuleAndSectionAPIsTestCase(TestBase):
- mydir = os.path.join("python_api", "module_section")
+ mydir = TestBase.compute_mydir(__file__)
@python_api_test
def test_module_and_section(self):
diff --git a/lldb/test/python_api/objc_type/TestObjCType.py b/lldb/test/python_api/objc_type/TestObjCType.py
index 35f83c4..ce31076 100644
--- a/lldb/test/python_api/objc_type/TestObjCType.py
+++ b/lldb/test/python_api/objc_type/TestObjCType.py
@@ -10,7 +10,7 @@
class ObjCSBTypeTestCase(TestBase):
- mydir = os.path.join("python_api", "objc_type")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py
index 016fc12..245c735 100644
--- a/lldb/test/python_api/process/TestProcessAPI.py
+++ b/lldb/test/python_api/process/TestProcessAPI.py
@@ -10,7 +10,7 @@
class ProcessAPITestCase(TestBase):
- mydir = os.path.join("python_api", "process")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/process/io/TestProcessIO.py b/lldb/test/python_api/process/io/TestProcessIO.py
index 1096bce..7352a8e 100644
--- a/lldb/test/python_api/process/io/TestProcessIO.py
+++ b/lldb/test/python_api/process/io/TestProcessIO.py
@@ -7,7 +7,7 @@
class ProcessIOTestCase(TestBase):
- mydir = os.path.join("python_api", "process", "io")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py b/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py
index 614a7ed..808e64b 100644
--- a/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py
+++ b/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py
@@ -11,7 +11,7 @@
class Radar12481949DataFormatterTestCase(TestBase):
# test for rdar://problem/12481949
- mydir = os.path.join("python_api", "rdar-12481949")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@dsym_test
diff --git a/lldb/test/python_api/sbdata/TestSBData.py b/lldb/test/python_api/sbdata/TestSBData.py
index 4fd227f..046339b 100644
--- a/lldb/test/python_api/sbdata/TestSBData.py
+++ b/lldb/test/python_api/sbdata/TestSBData.py
@@ -10,7 +10,7 @@
class SBDataAPICase(TestBase):
- mydir = os.path.join("python_api", "sbdata")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/symbol-context/TestSymbolContext.py b/lldb/test/python_api/symbol-context/TestSymbolContext.py
index 30d62ac..d7574ea 100644
--- a/lldb/test/python_api/symbol-context/TestSymbolContext.py
+++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py
@@ -10,7 +10,7 @@
class SymbolContextAPITestCase(TestBase):
- mydir = os.path.join("python_api", "symbol-context")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py
index 8f2a6de..5516ee6 100644
--- a/lldb/test/python_api/target/TestTargetAPI.py
+++ b/lldb/test/python_api/target/TestTargetAPI.py
@@ -10,7 +10,7 @@
class TargetAPITestCase(TestBase):
- mydir = os.path.join("python_api", "target")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py
index 1d22550..7cb97cd 100644
--- a/lldb/test/python_api/thread/TestThreadAPI.py
+++ b/lldb/test/python_api/thread/TestThreadAPI.py
@@ -10,7 +10,7 @@
class ThreadAPITestCase(TestBase):
- mydir = os.path.join("python_api", "thread")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/type/TestTypeList.py b/lldb/test/python_api/type/TestTypeList.py
index a06259d..ce0a166 100644
--- a/lldb/test/python_api/type/TestTypeList.py
+++ b/lldb/test/python_api/type/TestTypeList.py
@@ -10,7 +10,7 @@
class TypeAndTypeListTestCase(TestBase):
- mydir = os.path.join("python_api", "type")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/value/TestValueAPI.py b/lldb/test/python_api/value/TestValueAPI.py
index 0d6d341..0240888 100644
--- a/lldb/test/python_api/value/TestValueAPI.py
+++ b/lldb/test/python_api/value/TestValueAPI.py
@@ -10,7 +10,7 @@
class ValueAPITestCase(TestBase):
- mydir = os.path.join("python_api", "value")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
index 3d80fa3..b716335 100644
--- a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
+++ b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
@@ -10,7 +10,7 @@
class ChangeValueAPITestCase(TestBase):
- mydir = os.path.join("python_api", "value", "change_values")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
index f022ec4..c20cc31 100644
--- a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
+++ b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
@@ -11,7 +11,7 @@
class ValueAsLinkedListTestCase(TestBase):
- mydir = os.path.join("python_api", "value", "linked_list")
+ mydir = TestBase.compute_mydir(__file__)
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
diff --git a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py
index 8c09019..37a9e55 100644
--- a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py
+++ b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py
@@ -10,7 +10,7 @@
class SetWatchpointAPITestCase(TestBase):
- mydir = os.path.join("python_api", "watchpoint")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
index db169e8..b79ef25 100644
--- a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
+++ b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
@@ -10,7 +10,7 @@
class WatchpointIgnoreCountTestCase(TestBase):
- mydir = os.path.join("python_api", "watchpoint")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIter.py b/lldb/test/python_api/watchpoint/TestWatchpointIter.py
index e0fd624..8efa10b 100644
--- a/lldb/test/python_api/watchpoint/TestWatchpointIter.py
+++ b/lldb/test/python_api/watchpoint/TestWatchpointIter.py
@@ -10,7 +10,7 @@
class WatchpointIteratorTestCase(TestBase):
- mydir = os.path.join("python_api", "watchpoint")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py b/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
index f756626..a38b9d6 100644
--- a/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
+++ b/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
@@ -10,7 +10,7 @@
class WatchpointConditionAPITestCase(TestBase):
- mydir = os.path.join("python_api", "watchpoint", "condition")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
index d9904e8..9380c4c 100644
--- a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
+++ b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
@@ -10,7 +10,7 @@
class SetWatchlocationAPITestCase(TestBase):
- mydir = os.path.join("python_api", "watchpoint", "watchlocation")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
index 4d05fd6..c051f98 100644
--- a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
+++ b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
@@ -10,7 +10,7 @@
class TargetWatchAddressAPITestCase(TestBase):
- mydir = os.path.join("python_api", "watchpoint", "watchlocation")
+ mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().