diff options
-rw-r--r-- | src/testlib/qtestlog.cpp | 6 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/expected_blacklisted.tap | 10 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/expected_blacklisted.txt | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 212dc927a4..7e311d273e 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtTest module of the Qt Toolkit. @@ -337,6 +337,8 @@ void QTestLog::addXFail(const char *msg, const char *file, int line) { QTEST_ASSERT(msg); + // Will be counted in addPass() if we get there. + FOREACH_TEST_LOGGER logger->addIncident(QAbstractTestLogger::XFail, msg, file, line); } @@ -385,7 +387,7 @@ void QTestLog::addBXFail(const char *msg, const char *file, int line) { QTEST_ASSERT(msg); - ++QTest::blacklists; + // Will be counted in addBPass() if we get there. FOREACH_TEST_LOGGER logger->addIncident(QAbstractTestLogger::BlacklistedXFail, msg, file, line); diff --git a/tests/auto/testlib/selftests/expected_blacklisted.tap b/tests/auto/testlib/selftests/expected_blacklisted.tap index fee7750a12..f75fabbdd2 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.tap +++ b/tests/auto/testlib/selftests/expected_blacklisted.tap @@ -15,16 +15,16 @@ not ok 4 - fail() # TODO 'false' returned FALSE. (This test should BFAIL) file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp line: 0 ... -not ok 6 - xfail() # TODO This test should BXFAIL then BPASS +not ok 5 - xfail() # TODO This test should BXFAIL then BPASS --- # This test should BXFAIL then BPASS at: tst_Blacklisted::xfail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0) file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp line: 0 ... -ok 7 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS) -ok 8 - cleanupTestCase() -1..8 -# tests 8 +ok 6 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS) +ok 7 - cleanupTestCase() +1..7 +# tests 7 # pass 2 # fail 0 diff --git a/tests/auto/testlib/selftests/expected_blacklisted.txt b/tests/auto/testlib/selftests/expected_blacklisted.txt index 62a2d11ed2..b633578029 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.txt +++ b/tests/auto/testlib/selftests/expected_blacklisted.txt @@ -12,5 +12,5 @@ BPASS : tst_Blacklisted::xfail() BXPASS : tst_Blacklisted::xpass() 'true' returned TRUE unexpectedly. (This test should BXPASS) Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] PASS : tst_Blacklisted::cleanupTestCase() -Totals: 2 passed, 0 failed, 1 skipped, 5 blacklisted, 0ms +Totals: 2 passed, 0 failed, 1 skipped, 4 blacklisted, 0ms ********* Finished testing of tst_Blacklisted ********* |