forked from OSchip/llvm-project
Update TestRegisters for running on Linux (filed llvm.org/pr16301)
- skip the attach cases in TestRegisters.py -- caused slowness/sigabrt - fixed log file removal function (in case test is run with -# flag) llvm-svn: 183812
This commit is contained in:
parent
81db71ff07
commit
c087a6bd54
|
@ -45,6 +45,7 @@ class RegisterCommandsTestCase(TestBase):
|
|||
self.buildDefault()
|
||||
self.convenience_registers()
|
||||
|
||||
@skipIfLinux # llvm.org/pr16301 LLDB occasionally exits with SIGABRT
|
||||
def test_convenience_registers_with_process_attach(self):
|
||||
"""Test convenience registers after a 'process attach'."""
|
||||
if not self.getArchitecture() in ['x86_64']:
|
||||
|
@ -53,6 +54,7 @@ class RegisterCommandsTestCase(TestBase):
|
|||
self.convenience_registers_with_process_attach(test_16bit_regs=False)
|
||||
|
||||
@expectedFailureLinux("llvm.org/pr14600") # Linux doesn't support 16-bit convenience registers
|
||||
@skipIfLinux # llvm.org/pr16301 LLDB occasionally exits with SIGABRT
|
||||
def test_convenience_registers_16bit_with_process_attach(self):
|
||||
"""Test convenience registers after a 'process attach'."""
|
||||
if not self.getArchitecture() in ['x86_64']:
|
||||
|
@ -74,6 +76,11 @@ class RegisterCommandsTestCase(TestBase):
|
|||
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
|
||||
substrs = ['stopped', 'stop reason = breakpoint'])
|
||||
|
||||
def remove_log(self):
|
||||
""" Remove the temporary log file generated by some tests."""
|
||||
if os.path.exists(self.log_file):
|
||||
os.remove(self.log_file)
|
||||
|
||||
# platform specific logging of the specified category
|
||||
def log_enable(self, category):
|
||||
self.platform = ""
|
||||
|
@ -83,11 +90,11 @@ class RegisterCommandsTestCase(TestBase):
|
|||
self.platform = "linux"
|
||||
|
||||
if self.platform != "":
|
||||
log_file = os.path.join(os.getcwd(), 'TestRegisters.log')
|
||||
self.runCmd("log enable " + self.platform + " " + str(category) + " registers -v -f " + log_file, RUN_SUCCEEDED)
|
||||
self.log_file = os.path.join(os.getcwd(), 'TestRegisters.log')
|
||||
self.runCmd("log enable " + self.platform + " " + str(category) + " registers -v -f " + self.log_file, RUN_SUCCEEDED)
|
||||
if not self.has_teardown:
|
||||
self.has_teardown = True
|
||||
self.addTearDownHook(lambda: os.remove(log_file))
|
||||
self.addTearDownHook(self.remove_log)
|
||||
|
||||
def register_commands(self):
|
||||
"""Test commands related to registers, in particular vector registers."""
|
||||
|
|
Loading…
Reference in New Issue