[Lldb-commits] [lldb] r180109 - Splits register_commands into a passing test on Linux (to improve test coverage),

Ashok Thirumurthi ashok.thirumurthi at intel.com
Tue Apr 23 07:32:25 PDT 2013


Author: athirumu
Date: Tue Apr 23 09:32:25 2013
New Revision: 180109

URL: http://llvm.org/viewvc/llvm-project?rev=180109&view=rev
Log:
Splits register_commands into a passing test on Linux (to improve test coverage), 
and a failing test for register expressions.

Also factors out common setup code in preparation to add a few new tests.
Reviewed by: Daniel Malea

Modified:
    lldb/trunk/test/functionalities/register/TestRegisters.py

Modified: lldb/trunk/test/functionalities/register/TestRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=180109&r1=180108&r2=180109&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Tue Apr 23 09:32:25 2013
@@ -14,12 +14,19 @@ class RegisterCommandsTestCase(TestBase)
     mydir = os.path.join("functionalities", "register")
 
     def test_register_commands(self):
-        """Test commands related to registers, in particular xmm registers."""
+        """Test commands related to registers, in particular vector registers."""
         if not self.getArchitecture() in ['i386', 'x86_64']:
             self.skipTest("This test requires i386 or x86_64 as the architecture for the inferior")
         self.buildDefault()
         self.register_commands()
 
+    def test_register_expressions(self):
+        """Test expression evaluation with commands related to registers."""
+        if not self.getArchitecture() in ['i386', 'x86_64']:
+            self.skipTest("This test requires i386 or x86_64 as the architecture for the inferior")
+        self.buildDefault()
+        self.register_expressions()
+
     @expectedFailureLinux # bugzilla 14600 - Convenience registers not supported on Linux
     def test_convenience_registers(self):
         """Test convenience registers."""
@@ -36,9 +43,7 @@ class RegisterCommandsTestCase(TestBase)
         self.buildDefault()
         self.convenience_registers_with_process_attach()
 
-    @expectedFailureLinux # bugzilla 14661 - Expressions involving XMM registers fail on Linux
-    def register_commands(self):
-        """Test commands related to registers, in particular xmm registers."""
+    def common_setup(self):
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
@@ -51,7 +56,9 @@ class RegisterCommandsTestCase(TestBase)
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
             substrs = ['stopped', 'stop reason = breakpoint'])
 
-        # Test some register-related commands.
+    def register_commands(self):
+        """Test commands related to registers, in particular vector registers."""
+        self.common_setup()
 
         self.expect("register read -a", MISSING_EXPECTED_REGISTERS,
             substrs = ['registers were unavailable'], matching = False)
@@ -61,6 +68,11 @@ class RegisterCommandsTestCase(TestBase)
         self.expect("register read -s 3",
             substrs = ['invalid register set index: 3'], error = True)
 
+    @expectedFailureLinux # bugzilla 14661 - Expressions involving XMM registers fail on Linux
+    def register_expressions(self):
+        """Test expression evaluation with commands related to registers."""
+        self.common_setup()
+
         # rdar://problem/10611315
         # expression command doesn't handle xmm or stmm registers...
         self.expect("expr $xmm0",
@@ -71,17 +83,7 @@ class RegisterCommandsTestCase(TestBase)
 
     def convenience_registers(self):
         """Test convenience registers."""
-        exe = os.path.join(os.getcwd(), "a.out")
-        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-        # Break in main().
-        lldbutil.run_break_set_by_symbol (self, "main", num_expected_locations=-1)
-
-        self.runCmd("run", RUN_SUCCEEDED)
-
-        # The stop reason of the thread should be breakpoint.
-        self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = ['stopped', 'stop reason = breakpoint'])
+        self.common_setup()
 
         # The vanilla "register read" command does not output derived register like eax.
         self.expect("register read", matching=False,





More information about the lldb-commits mailing list