[Lldb-commits] [lldb] r133537 - in /lldb/trunk/test/types: AbstractBase.py TestFailures.py

Johnny Chen johnny.chen at apple.com
Tue Jun 21 12:47:11 PDT 2011


Author: johnny
Date: Tue Jun 21 14:47:11 2011
New Revision: 133537

URL: http://llvm.org/viewvc/llvm-project?rev=133537&view=rev
Log:
Add a test file "TestFailures.py" to try to capture test failures which occur when running
with no delay between successive test cases.  This one happend to capture a test failure where
the inferior shoud stop at a breakpoint but did not (radar will be filed to capture the log files
as well as the test session files):

[12:40:37] johnny:/Volumes/data/lldb/svn/trunk/test $ DEBUG_LLDB_LOG=/tmp/lldb.log DEBUG_GDB_REMOTE_LOG=/tmp/gdb-remote.log ./dotest.py -v -p TestFailures.py
LLDB-63
Path: /Volumes/data/lldb/svn/trunk
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 133529
Node Kind: directory
Schedule: normal
Last Changed Author: jmolenda
Last Changed Rev: 133500
Last Changed Date: 2011-06-20 19:57:15 -0700 (Mon, 20 Jun 2011)



Session logs for test failures/errors/unexpected successes will go into directory '2011-06-21-12_40_42'
Command invoked: python ./dotest.py -v -p TestFailures.py
----------------------------------------------------------------------
Collected 10 tests

 1: test_char_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that char-type variables are displayed correctly. ... ok
 2: test_char_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that char-type variables are displayed correctly. ... ok
 3: test_int_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that int-type variables are displayed correctly. ... ok
 4: test_int_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that int-type variables are displayed correctly. ... ok
 5: test_long_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that 'long long'-type variables are displayed correctly. ... FAIL
 6: test_long_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that 'long long'-type variables are displayed correctly. ... ok
 7: test_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that long-type variables are displayed correctly. ... TestFailures.DebugIntegerTypesFailures.test_long_type_with_dsym
FAIL
 8: test_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that long-type variables are displayed correctly. ... FAIL
 9: test_short_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that short-type variables are displayed correctly. ... ok
10: test_short_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that short-type variables are displayed correctly. ... ok

======================================================================
FAIL: test_long_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that 'long long'-type variables are displayed correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 102, in test_long_long_type_with_dsym
    self.long_long_type()
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 129, in long_long_type
    self.generic_type_tester(set(['long long']))
  File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester
    "stop reason = breakpoint"])
  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : Process should be stopped due to breakpoint

======================================================================
FAIL: test_long_type_with_dsym (TestFailures.DebugIntegerTypesFailures)
    Test that long-type variables are displayed correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 87, in test_long_type_with_dsym
    self.long_type()
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 125, in long_type
    self.generic_type_tester(set(['long']))
  File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester
    "stop reason = breakpoint"])
  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : Process should be stopped due to breakpoint

======================================================================
FAIL: test_long_type_with_dwarf (TestFailures.DebugIntegerTypesFailures)
    Test that long-type variables are displayed correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 94, in test_long_type_with_dwarf
    self.long_type()
  File "/Volumes/data/lldb/svn/trunk/test/types/TestFailures.py", line 125, in long_type
    self.generic_type_tester(set(['long']))
  File "/Volumes/data/lldb/svn/trunk/test/types/AbstractBase.py", line 67, in generic_type_tester
    "stop reason = breakpoint"])
  File "/Volumes/data/lldb/svn/trunk/test/lldbtest.py", line 863, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : Process should be stopped due to breakpoint

----------------------------------------------------------------------
Ran 10 tests in 5.617s

FAILED (failures=3)
Session logs for test failures/errors/unexpected successes can be found in directory '2011-06-21-12_40_42'
[12:40:47] johnny:/Volumes/data/lldb/svn/trunk/test $ 

Added:
    lldb/trunk/test/types/TestFailures.py
Modified:
    lldb/trunk/test/types/AbstractBase.py

Modified: lldb/trunk/test/types/AbstractBase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133537&r1=133536&r2=133537&view=diff
==============================================================================
--- lldb/trunk/test/types/AbstractBase.py (original)
+++ lldb/trunk/test/types/AbstractBase.py Tue Jun 21 14:47:11 2011
@@ -22,14 +22,14 @@
 
     # FIXME: Remove this method when/if we find out the cause of the failures
     # if no delays are inserted between test cases.
-    def setUp(self):
-        # Call super's setUp().
-        TestBase.setUp(self)
-        # Insert some delay for running test cases under test/types if not
-        # already so by the TestBase.setUp().
-        if "LLDB_WAIT_BETWEEN_TEST_CASES" not in os.environ:
-            #print "some delay, please ...."
-            time.sleep(1.0)
+#     def setUp(self):
+#         # Call super's setUp().
+#         TestBase.setUp(self)
+#         # Insert some delay for running test cases under test/types if not
+#         # already so by the TestBase.setUp().
+#         if "LLDB_WAIT_BETWEEN_TEST_CASES" not in os.environ:
+#             #print "some delay, please ...."
+#             time.sleep(1.0)
 
     def generic_type_tester(self, atoms, quotedDisplay=False):
         """Test that variables with basic types are displayed correctly."""

Added: lldb/trunk/test/types/TestFailures.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/TestFailures.py?rev=133537&view=auto
==============================================================================
--- lldb/trunk/test/types/TestFailures.py (added)
+++ lldb/trunk/test/types/TestFailures.py Tue Jun 21 14:47:11 2011
@@ -0,0 +1,136 @@
+"""
+Test that variables of integer basic types are displayed correctly.
+"""
+
+import AbstractBase
+import unittest2
+import sys
+import lldb
+from lldbtest import *
+
+class DebugIntegerTypesFailures(AbstractBase.GenericTester):
+
+    mydir = "types"
+
+    def setUp(self):
+        # Call super's setUp().
+        TestBase.setUp(self)
+        # If we're lucky, test_long_long_type_with_dsym fails.
+        # Let's turn on logging just for that.
+        if "test_long_long_type_with_dsym" in self.id():
+            self.runCmd(
+                "log enable -n -f %s lldb event process state" % os.environ["DEBUG_LLDB_LOG"])
+            self.runCmd(
+                "log enable -n -f %s gdb-remote packets process" % os.environ["DEBUG_GDB_REMOTE_LOG"])
+
+    def tearDown(self):
+        # Call super's tearDown().
+        TestBase.tearDown(self)
+        # If we're lucky, test_long_long_type_with_dsym fails.
+        # Let's turn off logging just for that.
+        if "test_long_long_type_with_dsym" in self.id():
+            self.runCmd("log disable lldb")
+            self.runCmd("log disable gdb-remote")
+
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    def test_char_type_with_dsym(self):
+        """Test that char-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'char.cpp'}
+        self.buildDsym(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.char_type()
+
+    def test_char_type_with_dwarf(self):
+        """Test that char-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'char.cpp'}
+        self.buildDwarf(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.char_type()
+
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    def test_short_type_with_dsym(self):
+        """Test that short-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'short.cpp'}
+        self.buildDsym(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.short_type()
+
+    def test_short_type_with_dwarf(self):
+        """Test that short-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'short.cpp'}
+        self.buildDwarf(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.short_type()
+
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    def test_int_type_with_dsym(self):
+        """Test that int-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'int.cpp'}
+        self.buildDsym(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.int_type()
+
+    def test_int_type_with_dwarf(self):
+        """Test that int-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'int.cpp'}
+        self.buildDwarf(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.int_type()
+
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    def test_long_type_with_dsym(self):
+        """Test that long-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'long.cpp'}
+        print self.id()
+        self.buildDsym(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.long_type()
+
+    def test_long_type_with_dwarf(self):
+        """Test that long-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'long.cpp'}
+        self.buildDwarf(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.long_type()
+
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    def test_long_long_type_with_dsym(self):
+        """Test that 'long long'-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'long_long.cpp'}
+        self.buildDsym(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.long_long_type()
+
+    def test_long_long_type_with_dwarf(self):
+        """Test that 'long long'-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'long_long.cpp'}
+        self.buildDwarf(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.long_long_type()
+
+    def char_type(self):
+        """Test that char-type variables are displayed correctly."""
+        self.generic_type_tester(set(['char']), quotedDisplay=True)
+
+    def int_type(self):
+        """Test that int-type variables are displayed correctly."""
+        self.generic_type_tester(set(['int']))
+
+    def short_type(self):
+        """Test that short-type variables are displayed correctly."""
+        self.generic_type_tester(set(['short']))
+
+    def long_type(self):
+        """Test that long-type variables are displayed correctly."""
+        self.generic_type_tester(set(['long']))
+
+    def long_long_type(self):
+        """Test that long long-type variables are displayed correctly."""
+        self.generic_type_tester(set(['long long']))
+
+
+if __name__ == '__main__':
+    import atexit
+    lldb.SBDebugger.Initialize()
+    atexit.register(lambda: lldb.SBDebugger.Terminate())
+    unittest2.main()





More information about the lldb-commits mailing list