[Lldb-commits] [lldb] r180876 - Refactored convenience register tests to provide some coverage on Linux that is not marked xfail.

Ashok Thirumurthi ashok.thirumurthi at intel.com
Wed May 1 13:07:14 PDT 2013


Author: athirumu
Date: Wed May  1 15:07:13 2013
New Revision: 180876

URL: http://llvm.org/viewvc/llvm-project?rev=180876&view=rev
Log:
Refactored convenience register tests to provide some coverage on Linux that is not marked xfail.

- Also minor improvements to the comments and the expected results.

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=180876&r1=180875&r2=180876&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Wed May  1 15:07:13 2013
@@ -34,7 +34,6 @@ class RegisterCommandsTestCase(TestBase)
         self.buildDefault()
         self.register_expressions()
 
-    @expectedFailureLinux # bugzilla 14600 - Convenience registers not supported on Linux
     def test_convenience_registers(self):
         """Test convenience registers."""
         if not self.getArchitecture() in ['x86_64']:
@@ -42,7 +41,7 @@ class RegisterCommandsTestCase(TestBase)
         self.buildDefault()
         self.convenience_registers()
 
-    @expectedFailureLinux # bugzilla 14600 - Convenience registers not supported on Linux
+    @expectedFailureLinux # bugzilla 14600 - Convenience registers not fully supported on Linux
     def test_convenience_registers_with_process_attach(self):
         """Test convenience registers after a 'process attach'."""
         if not self.getArchitecture() in ['x86_64']:
@@ -168,23 +167,18 @@ class RegisterCommandsTestCase(TestBase)
         """Test convenience registers."""
         self.common_setup()
 
-        # The vanilla "register read" command does not output derived register like eax.
-        self.expect("register read", matching=False,
-            substrs = ['eax'])
-        # While "register read -a" does output derived register like eax.
+        # The command "register read -a" does output a derived register like eax.
         self.expect("register read -a", matching=True,
             substrs = ['eax'])
-        
+
         # Test reading of rax and eax.
         self.expect("register read rax eax",
             substrs = ['rax = 0x', 'eax = 0x'])
 
         # Now write rax with a unique bit pattern and test that eax indeed represents the lower half of rax.
         self.runCmd("register write rax 0x1234567887654321")
-        self.expect("expr -- ($rax & 0xffffffff) == $eax",
-            substrs = ['true'])
-        self.expect("expr -- $ax == (($ah << 8) | $al)",
-            substrs = ['true'])
+        self.expect("register read rax 0x1234567887654321",
+            substrs = ['0x1234567887654321'])
 
     def convenience_registers_with_process_attach(self):
         """Test convenience registers after a 'process attach'."""
@@ -202,6 +196,14 @@ class RegisterCommandsTestCase(TestBase)
         # Check that "register read eax" works.
         self.runCmd("register read eax")
 
+        # The vanilla "register read" command should not output derived registers like eax.
+        self.expect("register read", matching=False,
+            substrs = ['eax'])
+        
+        self.expect("expr -- ($rax & 0xffffffff) == $eax",
+            substrs = ['true'])
+        self.expect("expr -- $ax == (($ah << 8) | $al)",
+            substrs = ['true'])
 
 if __name__ == '__main__':
     import atexit





More information about the lldb-commits mailing list