From: Daniel Malea Date: Wed, 12 Jun 2013 00:13:43 +0000 (+0000) Subject: Update TestRegisters for running on Linux (filed llvm.org/pr16301) X-Git-Tag: llvmorg-3.4.0-rc1~10838 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c087a6bd54008eac61df0928ba69ad16698b20cf;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/lldb/test/functionalities/register/TestRegisters.py b/lldb/test/functionalities/register/TestRegisters.py index ce546eb0ebd5..e58ed14724ef 100644 --- a/lldb/test/functionalities/register/TestRegisters.py +++ b/lldb/test/functionalities/register/TestRegisters.py @@ -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."""