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.

llvm-svn: 122901
This commit is contained in:
Johnny Chen 2011-01-05 20:24:11 +00:00
parent 7a808c0f00
commit 77c81d3ee7
1 changed files with 12 additions and 0 deletions

View File

@ -792,6 +792,18 @@ for ia in range(len(archs) if iterArchs else 1):
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