diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-12-20 20:44:23 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-12-20 20:44:23 +0000 |
| commit | dcc8fc9e985f16a6df878ec0ff7212e0a2da0c8f (patch) | |
| tree | e66790e7035a5a7dbdd67ebfe3655cb80926a003 /lldb | |
| parent | 3b7e8b2dbb1213d35917556f3e917d7add583506 (diff) | |
| download | bcm5719-llvm-dcc8fc9e985f16a6df878ec0ff7212e0a2da0c8f.tar.gz bcm5719-llvm-dcc8fc9e985f16a6df878ec0ff7212e0a2da0c8f.zip | |
[dotest] Consider unexpected passes as failures.
Unexpected successes should be considered failures because they can hide
regressions when not addressed. When a test is fixed and not re-enabled,
it can easily regress without us noticing.
I couldn't find a good way to make this change other than changing it in
the unittest2 framework. I know this is less than optimal but since we
have the dependency checked in and the change is pretty fundamental to
the framework I think it's not unreasonable.
Differential revision: https://reviews.llvm.org/D55835
llvm-svn: 349818
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/lit/Suite/lldbtest.py | 9 | ||||
| -rw-r--r-- | lldb/third_party/Python/module/unittest2/unittest2/result.py | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lldb/lit/Suite/lldbtest.py b/lldb/lit/Suite/lldbtest.py index 16b0b2ed7e1..12591f3ba50 100644 --- a/lldb/lit/Suite/lldbtest.py +++ b/lldb/lit/Suite/lldbtest.py @@ -94,11 +94,10 @@ class LLDBTest(TestFormat): litConfig.maxIndividualTestTime)) if exitCode: - return lit.Test.FAIL, out + err - - unexpected_test_line = 'XPASS' - if unexpected_test_line in out or unexpected_test_line in err: - return lit.Test.XPASS, '' + if 'FAIL:' in out or 'FAIL:' in err: + return lit.Test.FAIL, out + err + if 'XPASS:' in out or 'XPASS:' in err: + return lit.Test.XPASS, out + err passing_test_line = 'RESULT: PASSED' if passing_test_line not in out and passing_test_line not in err: diff --git a/lldb/third_party/Python/module/unittest2/unittest2/result.py b/lldb/third_party/Python/module/unittest2/unittest2/result.py index 9d76429fb4a..8f89816b772 100644 --- a/lldb/third_party/Python/module/unittest2/unittest2/result.py +++ b/lldb/third_party/Python/module/unittest2/unittest2/result.py @@ -148,7 +148,9 @@ class TestResult(unittest.TestResult): def wasSuccessful(self): "Tells whether or not this result was a success" - return (len(self.failures) + len(self.errors) == 0) + return (len(self.failures) + + len(self.errors) + + len(self.unexpectedSuccesses) == 0) def stop(self): "Indicates that the tests should be aborted" |

