[Lldb-commits] [lldb] r117066 - /lldb/trunk/docs/testsuite/best-practices.txt

Johnny Chen johnny.chen at apple.com
Thu Oct 21 14:39:02 PDT 2010


Author: johnny
Date: Thu Oct 21 16:39:02 2010
New Revision: 117066

URL: http://llvm.org/viewvc/llvm-project?rev=117066&view=rev
Log:
Add more information.

Modified:
    lldb/trunk/docs/testsuite/best-practices.txt

Modified: lldb/trunk/docs/testsuite/best-practices.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/testsuite/best-practices.txt?rev=117066&r1=117065&r2=117066&view=diff
==============================================================================
--- lldb/trunk/docs/testsuite/best-practices.txt (original)
+++ lldb/trunk/docs/testsuite/best-practices.txt Thu Oct 21 16:39:02 2010
@@ -37,3 +37,35 @@
 be skipped.  This is because we are asking to build the binaries with dsym debug
 info, which is only available on the darwin platforms.
 
+o Cleanup after yourself.  A classic example of this can be found in test/types/
+  TestFloatTypes.py:
+
+    def test_float_types_with_dsym(self):
+        """Test that float-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'float.cpp'}
+        self.buildDsym(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.float_type()
+
+    ...
+
+    def test_double_type_with_dsym(self):
+        """Test that double-type variables are displayed correctly."""
+        d = {'CXX_SOURCES': 'double.cpp'}
+        self.buildDsym(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        self.double_type()
+
+This tests different data structures composed of float types to verify that what
+the debugger prints out matches what the compiler does for different variables
+of these types.  We're using a dictionary to pass the build parameters to the
+build system.  After a particular test instance is done, it is a good idea to
+clean up the files built.  This eliminates the chance that some leftover files
+can interfere with the build phase for the next test instance and render it
+invalid.
+
+TestBase.setTearDownCleanup(self, dictionary) defined in lldbtest.py is created
+to cope with this use case by taking the same build parameters in order to do
+the cleanup when we are finished with a test instance, during
+TestBase.tearDown(self).
+





More information about the lldb-commits mailing list