[Lldb-commits] [lldb] r137678 - in /lldb/trunk/test: dotest.py lldbtest.py
Johnny Chen
johnny.chen at apple.com
Mon Aug 15 16:09:08 PDT 2011
Author: johnny
Date: Mon Aug 15 18:09:08 2011
New Revision: 137678
URL: http://llvm.org/viewvc/llvm-project?rev=137678&view=rev
Log:
Test driver should also report skipped tests because there were cases when tests were skipped
due to incorrect skip-logic.
Modified:
lldb/trunk/test/dotest.py
lldb/trunk/test/lldbtest.py
Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=137678&r1=137677&r2=137678&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Mon Aug 15 18:09:08 2011
@@ -1023,6 +1023,14 @@
if method:
method()
+ def addSkip(self, test, reason):
+ global sdir_has_content
+ sdir_has_content = True
+ super(LLDBTestResult, self).addSkip(test, reason)
+ method = getattr(test, "markSkippedTest", None)
+ if method:
+ method()
+
def addUnexpectedSuccess(self, test):
global sdir_has_content
sdir_has_content = True
Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=137678&r1=137677&r2=137678&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Mon Aug 15 18:09:08 2011
@@ -652,6 +652,15 @@
# Once by the Python unittest framework, and a second time by us.
print >> sbuf, "expected failure"
+ def markSkippedTest(self):
+ """Callback invoked when a test is skipped."""
+ self.__skipped__ = True
+ with recording(self, False) as sbuf:
+ # False because there's no need to write "skipped test" to the
+ # stderr twice.
+ # Once by the Python unittest framework, and a second time by us.
+ print >> sbuf, "skipped test"
+
def markUnexpectedSuccess(self):
"""Callback invoked when an unexpected success occurred."""
self.__unexpected__ = True
@@ -690,13 +699,15 @@
elif self.__expected__:
pairs = lldb.test_result.expectedFailures
prefix = 'ExpectedFailure'
+ elif self.__skipped__:
+ prefix = 'SkippedTest'
elif self.__unexpected__:
prefix = "UnexpectedSuccess"
else:
# Simply return, there's no session info to dump!
return
- if not self.__unexpected__:
+ if not self.__unexpected__ and not self.__skipped__:
for test, traceback in pairs:
if test is self:
print >> self.session, traceback
More information about the lldb-commits
mailing list