[Lldb-commits] [lldb] r122901 - /lldb/trunk/test/dotest.py

Johnny Chen johnny.chen at apple.com
Wed Jan 5 12:24:11 PST 2011


Author: johnny
Date: Wed Jan  5 14:24:11 2011
New Revision: 122901

URL: http://llvm.org/viewvc/llvm-project?rev=122901&view=rev
Log:
Enhance the test framework to be able to emit a counter value in verbose mode
describing the ordinal number of the currently running test case.

Modified:
    lldb/trunk/test/dotest.py

Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=122901&r1=122900&r2=122901&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Wed Jan  5 14:24:11 2011
@@ -792,6 +792,18 @@
                 LLDBTestResult.__singleton__ = self
                 # Now put this singleton into the lldb module namespace.
                 lldb.test_result = self
+                # Computes the format string for displaying the counter.
+                global suite
+                counterWidth = len(str(suite.countTestCases()))
+                self.fmt = "%" + str(counterWidth) + "d: "
+                # This counts from 1 .. suite.countTestCases().
+                self.counter = 0
+
+            def startTest(self, test):
+                self.counter += 1
+                if self.showAll:
+                    self.stream.write(self.fmt % self.counter)
+                super(LLDBTestResult, self).startTest(test)
 
             def addError(self, test, err):
                 global sdir_has_content





More information about the lldb-commits mailing list