JDevlieghere created this revision.
JDevlieghere added reviewers: mib, kastiglione.
Herald added a project: All.
JDevlieghere requested review of this revision.
I noticed a few Python API tests (`test/API/python_api`) were not marked as
`NO_DEBUG_INFO_TESTCASE` causing them to be rerun needlessly with different
debug info variants. Instead of adding `NO_DEBUG_INFO_TESTCASE`, I decided it
would be less error prone to convert all of them to a new test case format
(`PythonAPITest`) which has that property set.
https://reviews.llvm.org/D131539
Files:
lldb/packages/Python/lldbsuite/test/lldbtest.py
lldb/test/API/python_api/breakpoint/TestBreakpointAPI.py
lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py
lldb/test/API/python_api/debugger/TestDebuggerAPI.py
lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
lldb/test/API/python_api/event/TestEvents.py
lldb/test/API/python_api/file_handle/TestFileHandle.py
lldb/test/API/python_api/findvalue_duplist/TestSBFrameFindValue.py
lldb/test/API/python_api/formatters/TestFormattersSBAPI.py
lldb/test/API/python_api/frame/TestFrames.py
lldb/test/API/python_api/frame/get-variables/TestGetVariables.py
lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
lldb/test/API/python_api/get-value-32bit-int/TestGetValue32BitInt.py
lldb/test/API/python_api/hello_world/TestHelloWorld.py
lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py
lldb/test/API/python_api/interpreter/TestRunCommandInterpreterAPI.py
lldb/test/API/python_api/lldbutil/TestSwigVersion.py
lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
lldb/test/API/python_api/lldbutil/iter/TestLLDBIterator.py
lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
lldb/test/API/python_api/lldbutil/process/TestPrintStackTraces.py
lldb/test/API/python_api/module_section/TestModuleAndSection.py
lldb/test/API/python_api/name_lookup/TestNameLookup.py
lldb/test/API/python_api/objc_type/TestObjCType.py
lldb/test/API/python_api/process/TestProcessAPI.py
lldb/test/API/python_api/process/io/TestProcessIO.py
lldb/test/API/python_api/process/read-mem-cstring/TestReadMemCString.py
lldb/test/API/python_api/sbdata/TestSBData.py
lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
lldb/test/API/python_api/sberror/TestSBError.py
lldb/test/API/python_api/sblaunchinfo/TestSBLaunchInfo.py
lldb/test/API/python_api/sbmodule/TestSBModule.py
lldb/test/API/python_api/sbplatform/TestSBPlatform.py
lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
lldb/test/API/python_api/sbvalue_persist/TestSBValuePersist.py
lldb/test/API/python_api/section/TestSectionAPI.py
lldb/test/API/python_api/signals/TestSignalsAPI.py
lldb/test/API/python_api/symbol-context/TestSymbolContext.py
lldb/test/API/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
lldb/test/API/python_api/target/TestTargetAPI.py
lldb/test/API/python_api/thread/TestThreadAPI.py
lldb/test/API/python_api/type/TestTypeList.py
lldb/test/API/python_api/value/TestValueAPI.py
lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
lldb/test/API/python_api/value_var_update/TestValueVarUpdate.py
lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
Index: lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
===================================================================
--- lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
+++ lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
@@ -11,12 +11,11 @@
from lldbsuite.test import lldbutil
-class TargetWatchAddressAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class TargetWatchAddressAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Our simple source filename.
self.source = 'main.cpp'
# Find the line number to break inside main().
Index: lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
===================================================================
--- lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
+++ lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
@@ -12,12 +12,11 @@
from lldbsuite.test import lldbutil
-class SetWatchlocationAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SetWatchlocationAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Our simple source filename.
self.source = 'main.cpp'
# Find the line number to break inside main().
Index: lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
===================================================================
--- lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
+++ lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
@@ -11,12 +11,11 @@
from lldbsuite.test import lldbutil
-class WatchpointConditionAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class WatchpointConditionAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Our simple source filename.
self.source = 'main.cpp'
# Find the line number to break inside main().
Index: lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
===================================================================
--- lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
+++ lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
@@ -12,8 +12,7 @@
from lldbsuite.test import lldbutil
-class WatchpointIteratorTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class WatchpointIteratorTestCase(PythonAPITest):
# hardware watchpoints are not reported with a hardware index # on armv7 on ios devices
def affected_by_radar_34564183(self):
@@ -21,7 +20,7 @@
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Our simple source filename.
self.source = 'main.c'
# Find the line number to break inside main().
Index: lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
===================================================================
--- lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
+++ lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
@@ -11,12 +11,11 @@
from lldbsuite.test import lldbutil
-class WatchpointIgnoreCountTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class WatchpointIgnoreCountTestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Our simple source filename.
self.source = 'main.c'
# Find the line number to break inside main().
Index: lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
===================================================================
--- lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
+++ lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
@@ -11,12 +11,11 @@
from lldbsuite.test import lldbutil
-class SetWatchpointAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SetWatchpointAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Our simple source filename.
self.source = 'main.c'
# Find the line number to break inside main().
Index: lldb/test/API/python_api/value_var_update/TestValueVarUpdate.py
===================================================================
--- lldb/test/API/python_api/value_var_update/TestValueVarUpdate.py
+++ lldb/test/API/python_api/value_var_update/TestValueVarUpdate.py
@@ -8,7 +8,7 @@
from lldbsuite.test import lldbutil
-class ValueVarUpdateTestCase(TestBase):
+class ValueVarUpdateTestCase(PythonAPITest):
def test_with_process_launch_api(self):
"""Test SBValue::GetValueDidChange"""
Index: lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
===================================================================
--- lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
+++ lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
@@ -12,12 +12,11 @@
from lldbsuite.test import lldbutil
-class ValueAsLinkedListTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class ValueAsLinkedListTestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# We'll use the test method name as the exe_name.
self.exe_name = self.testMethodName
# Find the line number to break at.
Index: lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
===================================================================
--- lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
+++ lldb/test/API/python_api/value/empty_class/TestValueAPIEmptyClass.py
@@ -4,7 +4,7 @@
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-class ValueAPIEmptyClassTestCase(TestBase):
+class ValueAPIEmptyClassTestCase(PythonAPITest):
def test(self):
self.build()
Index: lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
===================================================================
--- lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
+++ lldb/test/API/python_api/value/change_values/TestChangeValueAPI.py
@@ -10,11 +10,11 @@
from lldbsuite.test import lldbutil
-class ChangeValueAPITestCase(TestBase):
+class ChangeValueAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# We'll use the test method name as the exe_name.
self.exe_name = self.testMethodName
# Find the line number to of function 'c'.
Index: lldb/test/API/python_api/value/TestValueAPI.py
===================================================================
--- lldb/test/API/python_api/value/TestValueAPI.py
+++ lldb/test/API/python_api/value/TestValueAPI.py
@@ -11,11 +11,11 @@
from lldbsuite.test import lldbutil
-class ValueAPITestCase(TestBase):
+class ValueAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# We'll use the test method name as the exe_name.
self.exe_name = self.testMethodName
# Find the line number to of function 'c'.
Index: lldb/test/API/python_api/type/TestTypeList.py
===================================================================
--- lldb/test/API/python_api/type/TestTypeList.py
+++ lldb/test/API/python_api/type/TestTypeList.py
@@ -12,11 +12,11 @@
from lldbsuite.test import lldbutil
-class TypeAndTypeListTestCase(TestBase):
+class TypeAndTypeListTestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# We'll use the test method name as the exe_name.
self.exe_name = self.testMethodName
# Find the line number to break at.
Index: lldb/test/API/python_api/thread/TestThreadAPI.py
===================================================================
--- lldb/test/API/python_api/thread/TestThreadAPI.py
+++ lldb/test/API/python_api/thread/TestThreadAPI.py
@@ -12,7 +12,7 @@
from lldbsuite.test.lldbutil import get_stopped_thread, get_caller_symbol
-class ThreadAPITestCase(TestBase):
+class ThreadAPITestCase(PythonAPITest):
def test_get_process(self):
"""Test Python SBThread.GetProcess() API."""
@@ -53,7 +53,7 @@
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number within main.cpp to break inside main().
self.break_line = line_number(
"main.cpp", "// Set break point at this line and check variable 'my_char'.")
Index: lldb/test/API/python_api/target/TestTargetAPI.py
===================================================================
--- lldb/test/API/python_api/target/TestTargetAPI.py
+++ lldb/test/API/python_api/target/TestTargetAPI.py
@@ -13,11 +13,11 @@
from lldbsuite.test import lldbutil
-class TargetAPITestCase(TestBase):
+class TargetAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to of function 'c'.
self.line1 = line_number(
'main.c', '// Find the line number for breakpoint 1 here.')
Index: lldb/test/API/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
===================================================================
--- lldb/test/API/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
+++ lldb/test/API/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
@@ -10,7 +10,7 @@
from lldbsuite.test import lldbutil
-class SymbolContextTwoFilesTestCase(TestBase):
+class SymbolContextTwoFilesTestCase(PythonAPITest):
@expectedFailureAll(oslist=["windows"])
def test_lookup_by_address(self):
Index: lldb/test/API/python_api/symbol-context/TestSymbolContext.py
===================================================================
--- lldb/test/API/python_api/symbol-context/TestSymbolContext.py
+++ lldb/test/API/python_api/symbol-context/TestSymbolContext.py
@@ -10,11 +10,11 @@
from lldbsuite.test import lldbutil
-class SymbolContextAPITestCase(TestBase):
+class SymbolContextAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to of function 'c'.
self.line = line_number(
'main.c', '// Find the line number of function "c" here.')
Index: lldb/test/API/python_api/signals/TestSignalsAPI.py
===================================================================
--- lldb/test/API/python_api/signals/TestSignalsAPI.py
+++ lldb/test/API/python_api/signals/TestSignalsAPI.py
@@ -11,8 +11,7 @@
from lldbsuite.test.lldbutil import get_stopped_thread, state_type_to_str
-class SignalsAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SignalsAPITestCase(PythonAPITest):
@skipIfWindows # Windows doesn't have signals
def test_ignore_signal(self):
Index: lldb/test/API/python_api/section/TestSectionAPI.py
===================================================================
--- lldb/test/API/python_api/section/TestSectionAPI.py
+++ lldb/test/API/python_api/section/TestSectionAPI.py
@@ -9,7 +9,7 @@
from lldbsuite.test import lldbutil
-class SectionAPITestCase(TestBase):
+class SectionAPITestCase(PythonAPITest):
def test_get_target_byte_size(self):
d = {'EXE': 'b.out'}
Index: lldb/test/API/python_api/sbvalue_persist/TestSBValuePersist.py
===================================================================
--- lldb/test/API/python_api/sbvalue_persist/TestSBValuePersist.py
+++ lldb/test/API/python_api/sbvalue_persist/TestSBValuePersist.py
@@ -8,8 +8,7 @@
from lldbsuite.test import lldbutil
-class SBValuePersistTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SBValuePersistTestCase(PythonAPITest):
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24772")
def test(self):
Index: lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
===================================================================
--- lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
+++ lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py
@@ -10,8 +10,7 @@
from lldbsuite.test import lldbutil
-class TestStructuredDataAPI(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class TestStructuredDataAPI(PythonAPITest):
def test(self):
self.structured_data_api_test()
Index: lldb/test/API/python_api/sbplatform/TestSBPlatform.py
===================================================================
--- lldb/test/API/python_api/sbplatform/TestSBPlatform.py
+++ lldb/test/API/python_api/sbplatform/TestSBPlatform.py
@@ -3,8 +3,7 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-class SBPlatformAPICase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SBPlatformAPICase(PythonAPITest):
@skipIfRemote # Remote environment not supported.
def test_run(self):
Index: lldb/test/API/python_api/sbmodule/TestSBModule.py
===================================================================
--- lldb/test/API/python_api/sbmodule/TestSBModule.py
+++ lldb/test/API/python_api/sbmodule/TestSBModule.py
@@ -7,14 +7,14 @@
import os, signal, subprocess
-class SBModuleAPICase(TestBase):
+class SBModuleAPICase(PythonAPITest):
def setUp(self):
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
self.background_pid = None
def tearDown(self):
- TestBase.tearDown(self)
+ PythonAPITest.tearDown(self)
if self.background_pid:
os.kill(self.background_pid, signal.SIGKILL)
Index: lldb/test/API/python_api/sblaunchinfo/TestSBLaunchInfo.py
===================================================================
--- lldb/test/API/python_api/sblaunchinfo/TestSBLaunchInfo.py
+++ lldb/test/API/python_api/sblaunchinfo/TestSBLaunchInfo.py
@@ -15,8 +15,7 @@
return Value
return ""
-class TestSBLaunchInfo(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class TestSBLaunchInfo(PythonAPITest):
def test_environment_getset(self):
info = lldb.SBLaunchInfo(None)
Index: lldb/test/API/python_api/sberror/TestSBError.py
===================================================================
--- lldb/test/API/python_api/sberror/TestSBError.py
+++ lldb/test/API/python_api/sberror/TestSBError.py
@@ -2,8 +2,7 @@
from lldbsuite.test.lldbtest import *
-class TestSBError(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class TestSBError(PythonAPITest):
def test_generic_error(self):
error = lldb.SBError()
Index: lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
===================================================================
--- lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
+++ lldb/test/API/python_api/sbenvironment/TestSBEnvironment.py
@@ -8,8 +8,7 @@
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-class SBEnvironmentAPICase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SBEnvironmentAPICase(PythonAPITest):
# We use this function to test both kind of accessors:
# . Get*AtIndex and GetEntries
Index: lldb/test/API/python_api/sbdata/TestSBData.py
===================================================================
--- lldb/test/API/python_api/sbdata/TestSBData.py
+++ lldb/test/API/python_api/sbdata/TestSBData.py
@@ -9,12 +9,11 @@
from lldbsuite.test import lldbutil
-class SBDataAPICase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SBDataAPICase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to break on inside main.cpp.
self.line = line_number('main.cpp', '// set breakpoint here')
Index: lldb/test/API/python_api/process/read-mem-cstring/TestReadMemCString.py
===================================================================
--- lldb/test/API/python_api/process/read-mem-cstring/TestReadMemCString.py
+++ lldb/test/API/python_api/process/read-mem-cstring/TestReadMemCString.py
@@ -8,8 +8,7 @@
from lldbsuite.test import lldbutil
-class TestReadMemCString(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class TestReadMemCString(PythonAPITest):
def test_read_memory_c_string(self):
"""Test corner case behavior of SBProcess::ReadCStringFromMemory"""
Index: lldb/test/API/python_api/process/io/TestProcessIO.py
===================================================================
--- lldb/test/API/python_api/process/io/TestProcessIO.py
+++ lldb/test/API/python_api/process/io/TestProcessIO.py
@@ -10,8 +10,7 @@
from lldbsuite.test import lldbutil
-class ProcessIOTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class ProcessIOTestCase(PythonAPITest):
def setup_test(self):
# Get the full path to our executable to be debugged.
Index: lldb/test/API/python_api/process/TestProcessAPI.py
===================================================================
--- lldb/test/API/python_api/process/TestProcessAPI.py
+++ lldb/test/API/python_api/process/TestProcessAPI.py
@@ -11,11 +11,11 @@
from lldbsuite.test.lldbutil import get_stopped_thread, state_type_to_str
-class ProcessAPITestCase(TestBase):
+class ProcessAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to break inside main().
self.line = line_number(
"main.cpp",
Index: lldb/test/API/python_api/objc_type/TestObjCType.py
===================================================================
--- lldb/test/API/python_api/objc_type/TestObjCType.py
+++ lldb/test/API/python_api/objc_type/TestObjCType.py
@@ -10,11 +10,11 @@
from lldbsuite.test import lldbutil
-class ObjCSBTypeTestCase(TestBase):
+class ObjCSBTypeTestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
self.line = line_number("main.m", '// Break at this line')
@add_test_categories(['objc', 'pyapi'])
Index: lldb/test/API/python_api/name_lookup/TestNameLookup.py
===================================================================
--- lldb/test/API/python_api/name_lookup/TestNameLookup.py
+++ lldb/test/API/python_api/name_lookup/TestNameLookup.py
@@ -11,7 +11,7 @@
from lldbsuite.test import lldbutil
-class TestNameLookup(TestBase):
+class TestNameLookup(PythonAPITest):
@expectedFailureAll(oslist=["windows"], bugnumber='llvm.org/pr21765')
def test_target(self):
Index: lldb/test/API/python_api/module_section/TestModuleAndSection.py
===================================================================
--- lldb/test/API/python_api/module_section/TestModuleAndSection.py
+++ lldb/test/API/python_api/module_section/TestModuleAndSection.py
@@ -12,7 +12,7 @@
from lldbsuite.test.lldbutil import symbol_type_to_str
-class ModuleAndSectionAPIsTestCase(TestBase):
+class ModuleAndSectionAPIsTestCase(PythonAPITest):
# Py3 asserts due to a bug in SWIG. A fix for this was upstreamed into
# SWIG 3.0.8.
Index: lldb/test/API/python_api/lldbutil/process/TestPrintStackTraces.py
===================================================================
--- lldb/test/API/python_api/lldbutil/process/TestPrintStackTraces.py
+++ lldb/test/API/python_api/lldbutil/process/TestPrintStackTraces.py
@@ -10,7 +10,7 @@
from lldbsuite.test import lldbutil
-class ThreadsStackTracesTestCase(TestBase):
+class ThreadsStackTracesTestCase(PythonAPITest):
def test_stack_traces(self):
"""Test SBprocess and SBThread APIs with printing of the stack traces."""
Index: lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
===================================================================
--- lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
+++ lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -11,11 +11,11 @@
from lldbsuite.test import lldbutil
-class RegistersIteratorTestCase(TestBase):
+class RegistersIteratorTestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to break inside main().
self.line1 = line_number(
'main.cpp', '// Set break point at this line.')
Index: lldb/test/API/python_api/lldbutil/iter/TestLLDBIterator.py
===================================================================
--- lldb/test/API/python_api/lldbutil/iter/TestLLDBIterator.py
+++ lldb/test/API/python_api/lldbutil/iter/TestLLDBIterator.py
@@ -11,11 +11,11 @@
from lldbsuite.test import lldbutil
-class LLDBIteratorTestCase(TestBase):
+class LLDBIteratorTestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line numbers to break inside main().
self.line1 = line_number(
'main.cpp', '// Set break point at this line.')
Index: lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
===================================================================
--- lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
+++ lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
@@ -11,11 +11,11 @@
from lldbsuite.test import lldbutil
-class FrameUtilsTestCase(TestBase):
+class FrameUtilsTestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to break inside main().
self.line = line_number('main.c',
"// Find the line number here.")
Index: lldb/test/API/python_api/lldbutil/TestSwigVersion.py
===================================================================
--- lldb/test/API/python_api/lldbutil/TestSwigVersion.py
+++ lldb/test/API/python_api/lldbutil/TestSwigVersion.py
@@ -13,8 +13,7 @@
"""
from lldbsuite.test.lldbtest import *
-class SwigVersionTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SwigVersionTestCase(PythonAPITest):
def test(self):
self.assertTrue(getattr(lldb, "swig_version"))
Index: lldb/test/API/python_api/interpreter/TestRunCommandInterpreterAPI.py
===================================================================
--- lldb/test/API/python_api/interpreter/TestRunCommandInterpreterAPI.py
+++ lldb/test/API/python_api/interpreter/TestRunCommandInterpreterAPI.py
@@ -5,12 +5,11 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-class CommandRunInterpreterLegacyAPICase(TestBase):
+class CommandRunInterpreterLegacyAPICase(PythonAPITest):
- NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
self.stdin_path = self.getBuildArtifact("stdin.txt")
@@ -40,12 +39,11 @@
self.assertFalse(has_crashed)
-class CommandRunInterpreterAPICase(TestBase):
+class CommandRunInterpreterAPICase(PythonAPITest):
- NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
self.stdin_path = self.getBuildArtifact("stdin.txt")
@@ -70,9 +68,8 @@
self.assertTrue(quit_requested)
self.assertFalse(has_crashed)
-class SBCommandInterpreterRunOptionsCase(TestBase):
+class SBCommandInterpreterRunOptionsCase(PythonAPITest):
- NO_DEBUG_INFO_TESTCASE = True
def test_command_interpreter_run_options(self):
"""Test SBCommandInterpreterRunOptions default values, getters & setters """
Index: lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py
===================================================================
--- lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py
+++ lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -9,12 +9,11 @@
from lldbsuite.test import lldbutil
-class CommandInterpreterAPICase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class CommandInterpreterAPICase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to break on inside main.cpp.
self.line = line_number('main.c', 'Hello world.')
Index: lldb/test/API/python_api/hello_world/TestHelloWorld.py
===================================================================
--- lldb/test/API/python_api/hello_world/TestHelloWorld.py
+++ lldb/test/API/python_api/hello_world/TestHelloWorld.py
@@ -9,21 +9,20 @@
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
-class HelloWorldTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class HelloWorldTestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find a couple of the line numbers within main.c.
self.line1 = line_number('main.c', '// Set break point at this line.')
self.line2 = line_number('main.c', '// Waiting to be attached...')
def tearDown(self):
- # Destroy process before TestBase.tearDown()
+ # Destroy process before PythonAPITest.tearDown()
self.dbg.GetSelectedTarget().GetProcess().Destroy()
# Call super's tearDown().
- TestBase.tearDown(self)
+ PythonAPITest.tearDown(self)
@skipIfiOSSimulator
def test_with_process_launch_api(self):
Index: lldb/test/API/python_api/get-value-32bit-int/TestGetValue32BitInt.py
===================================================================
--- lldb/test/API/python_api/get-value-32bit-int/TestGetValue32BitInt.py
+++ lldb/test/API/python_api/get-value-32bit-int/TestGetValue32BitInt.py
@@ -6,8 +6,7 @@
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
-class TestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class TestCase(PythonAPITest):
def test_with_run_command(self):
self.build()
Index: lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
===================================================================
--- lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
+++ lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
@@ -11,11 +11,11 @@
from lldbsuite.test import lldbutil
-class SymbolAPITestCase(TestBase):
+class SymbolAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to of function 'c'.
self.line1 = line_number(
'main.c', '// Find the line number for breakpoint 1 here.')
Index: lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
===================================================================
--- lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
+++ lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
@@ -11,11 +11,11 @@
from lldbsuite.test import lldbutil
-class DisasmAPITestCase(TestBase):
+class DisasmAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to of function 'c'.
self.line1 = line_number(
'main.c', '// Find the line number for breakpoint 1 here.')
Index: lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
===================================================================
--- lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
+++ lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
@@ -11,11 +11,11 @@
from lldbsuite.test import lldbutil
-class InlinedFrameAPITestCase(TestBase):
+class InlinedFrameAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to of function 'c'.
self.source = 'inlines.c'
self.first_stop = line_number(
Index: lldb/test/API/python_api/frame/get-variables/TestGetVariables.py
===================================================================
--- lldb/test/API/python_api/frame/get-variables/TestGetVariables.py
+++ lldb/test/API/python_api/frame/get-variables/TestGetVariables.py
@@ -19,11 +19,11 @@
return names
-class TestGetVariables(TestBase):
+class TestGetVariables(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
self.source = 'main.c'
def verify_variable_names(self, description, value_list, names):
Index: lldb/test/API/python_api/frame/TestFrames.py
===================================================================
--- lldb/test/API/python_api/frame/TestFrames.py
+++ lldb/test/API/python_api/frame/TestFrames.py
@@ -12,7 +12,7 @@
from lldbsuite.test import lldbutil
-class FrameAPITestCase(TestBase):
+class FrameAPITestCase(PythonAPITest):
def test_get_arg_vals_for_call_stack(self):
"""Exercise SBFrame.GetVariables() API to get argument vals."""
Index: lldb/test/API/python_api/formatters/TestFormattersSBAPI.py
===================================================================
--- lldb/test/API/python_api/formatters/TestFormattersSBAPI.py
+++ lldb/test/API/python_api/formatters/TestFormattersSBAPI.py
@@ -9,12 +9,11 @@
from lldbsuite.test import lldbutil
-class SBFormattersAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SBFormattersAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
self.line = line_number('main.cpp', '// Set break point at this line.')
def test_formatters_api(self):
Index: lldb/test/API/python_api/findvalue_duplist/TestSBFrameFindValue.py
===================================================================
--- lldb/test/API/python_api/findvalue_duplist/TestSBFrameFindValue.py
+++ lldb/test/API/python_api/findvalue_duplist/TestSBFrameFindValue.py
@@ -8,8 +8,7 @@
from lldbsuite.test import lldbutil
-class SBFrameFindValueTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class SBFrameFindValueTestCase(PythonAPITest):
def test_formatters_api(self):
"""Test that SBFrame::FindValue finds things but does not duplicate the entire variables list"""
Index: lldb/test/API/python_api/file_handle/TestFileHandle.py
===================================================================
--- lldb/test/API/python_api/file_handle/TestFileHandle.py
+++ lldb/test/API/python_api/file_handle/TestFileHandle.py
@@ -77,9 +77,8 @@
return list(i())
-class FileHandleTestCase(lldbtest.TestBase):
+class FileHandleTestCase(lldbtest.PythonAPITest):
- NO_DEBUG_INFO_TESTCASE = True
# The way normal tests evaluate debugger commands is
# by using a SBCommandInterpreter directly, which captures
Index: lldb/test/API/python_api/event/TestEvents.py
===================================================================
--- lldb/test/API/python_api/event/TestEvents.py
+++ lldb/test/API/python_api/event/TestEvents.py
@@ -13,12 +13,11 @@
@skipIfLinux # llvm.org/pr25924, sometimes generating SIGSEGV
-class EventAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class EventAPITestCase(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# Find the line number to of function 'c'.
self.line = line_number(
'main.c', '// Find the line number of function "c" here.')
Index: lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
===================================================================
--- lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
+++ lldb/test/API/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
@@ -13,7 +13,7 @@
from lldbsuite.test import lldbutil
-class Disassemble_VST1_64(TestBase):
+class Disassemble_VST1_64(PythonAPITest):
@no_debug_info_test
@skipIfLLVMTargetMissing("ARM")
Index: lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
===================================================================
--- lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -12,7 +12,7 @@
from lldbsuite.test import lldbutil
-class DisassembleRawDataTestCase(TestBase):
+class DisassembleRawDataTestCase(PythonAPITest):
@no_debug_info_test
@skipIfRemote
Index: lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
===================================================================
--- lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ lldb/test/API/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -20,8 +20,7 @@
from lldbsuite.test import lldbutil
-class APIDefaultConstructorTestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class APIDefaultConstructorTestCase(PythonAPITest):
def test_SBAddress(self):
obj = lldb.SBAddress()
Index: lldb/test/API/python_api/debugger/TestDebuggerAPI.py
===================================================================
--- lldb/test/API/python_api/debugger/TestDebuggerAPI.py
+++ lldb/test/API/python_api/debugger/TestDebuggerAPI.py
@@ -9,8 +9,7 @@
from lldbsuite.test import lldbutil
-class DebuggerAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class DebuggerAPITestCase(PythonAPITest):
def test_debugger_api_boundary_condition(self):
"""Exercise SBDebugger APIs with boundary conditions."""
Index: lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py
===================================================================
--- lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py
+++ lldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py
@@ -8,10 +8,10 @@
from lldbsuite.test import lldbutil
-class CompileUnitAPITestCase(TestBase):
+class CompileUnitAPITestCase(PythonAPITest):
def setUp(self):
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
def test(self):
"""Exercise some SBCompileUnit APIs."""
Index: lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
===================================================================
--- lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
+++ lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py
@@ -10,11 +10,11 @@
from lldbsuite.test import lldbutil
-class SBTypeMemberFunctionsTest(TestBase):
+class SBTypeMemberFunctionsTest(PythonAPITest):
def setUp(self):
# Call super's setUp().
- TestBase.setUp(self)
+ PythonAPITest.setUp(self)
# We'll use the test method name as the exe_name.
self.exe_name = self.testMethodName
# Find the line number to break at.
Index: lldb/test/API/python_api/breakpoint/TestBreakpointAPI.py
===================================================================
--- lldb/test/API/python_api/breakpoint/TestBreakpointAPI.py
+++ lldb/test/API/python_api/breakpoint/TestBreakpointAPI.py
@@ -8,8 +8,7 @@
from lldbsuite.test import lldbutil
-class BreakpointAPITestCase(TestBase):
- NO_DEBUG_INFO_TESTCASE = True
+class BreakpointAPITestCase(PythonAPITest):
def test_breakpoint_is_valid(self):
"""Make sure that if an SBBreakpoint gets deleted its IsValid returns false."""
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2567,6 +2567,12 @@
if os.path.exists(file):
remove_file(file)
+
+class PythonAPITest(TestBase):
+
+ NO_DEBUG_INFO_TESTCASE = True
+
+
# On Windows, the first attempt to delete a recently-touched file can fail
# because of a race with antimalware scanners. This function will detect a
# failure and retry.
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits