Make clear why QTestLog::addB?XFail() don't add to counters
This reverts commit 904617dfb83f39a6a379635b64fea6fcd00f241a and makes clear to future readers why that wouldn't be a sensible change. Update the test's data, eliminating a case of duplicate counting that was caused by the reverted commit. Task-number: QTBUG-95661 Change-Id: Ice6d3ab06ca171e0d6eb0fac757f1ab774e229f0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 7af79ba09148dbfe5c1fc8b130d564dcca7ae4b3)
This commit is contained in:
parent
c5a79d6dbc
commit
ee23accac7
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2020 The Qt Company Ltd.
|
** Copyright (C) 2021 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the QtTest module of the Qt Toolkit.
|
** This file is part of the QtTest module of the Qt Toolkit.
|
||||||
@ -338,6 +338,8 @@ void QTestLog::addXFail(const char *msg, const char *file, int line)
|
|||||||
QTEST_ASSERT(msg);
|
QTEST_ASSERT(msg);
|
||||||
QTEST_ASSERT(file);
|
QTEST_ASSERT(file);
|
||||||
|
|
||||||
|
// Will be counted in addPass() if we get there.
|
||||||
|
|
||||||
FOREACH_TEST_LOGGER
|
FOREACH_TEST_LOGGER
|
||||||
logger->addIncident(QAbstractTestLogger::XFail, msg, file, line);
|
logger->addIncident(QAbstractTestLogger::XFail, msg, file, line);
|
||||||
}
|
}
|
||||||
@ -390,7 +392,7 @@ void QTestLog::addBXFail(const char *msg, const char *file, int line)
|
|||||||
QTEST_ASSERT(msg);
|
QTEST_ASSERT(msg);
|
||||||
QTEST_ASSERT(file);
|
QTEST_ASSERT(file);
|
||||||
|
|
||||||
++QTest::blacklists;
|
// Will be counted in addBPass() if we get there.
|
||||||
|
|
||||||
FOREACH_TEST_LOGGER
|
FOREACH_TEST_LOGGER
|
||||||
logger->addIncident(QAbstractTestLogger::BlacklistedXFail, msg, file, line);
|
logger->addIncident(QAbstractTestLogger::BlacklistedXFail, msg, file, line);
|
||||||
|
@ -15,15 +15,15 @@ not ok 4 - fail() # TODO 'false' returned FALSE. (This test should BFAIL)
|
|||||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||||
line: 0
|
line: 0
|
||||||
...
|
...
|
||||||
not ok 5 - xfail() # TODO This test should BXFAIL then BPASS
|
not ok 4 - xfail() # TODO This test should BXFAIL then BPASS
|
||||||
---
|
---
|
||||||
# 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)
|
at: tst_Blacklisted::xfail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
|
||||||
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
|
||||||
line: 0
|
line: 0
|
||||||
...
|
...
|
||||||
ok 6 - xfail() # TODO
|
ok 5 - xfail() # TODO
|
||||||
ok 7 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS)
|
ok 6 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS)
|
||||||
# This is a warning that should not appear in silent test output
|
# This is a warning that should not appear in silent test output
|
||||||
# This is an internal testlib warning that should not appear in silent test output
|
# This is an internal testlib warning that should not appear in silent test output
|
||||||
# This is a debug message that should not appear in silent test output
|
# This is a debug message that should not appear in silent test output
|
||||||
@ -31,14 +31,14 @@ ok 7 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPAS
|
|||||||
# This is an info message that should not appear in silent test output
|
# This is an info message that should not appear in silent test output
|
||||||
# This is an internal testlib info message that should not appear in silent test output
|
# This is an internal testlib info message that should not appear in silent test output
|
||||||
# This is a fatal error message that should still appear in silent test output
|
# This is a fatal error message that should still appear in silent test output
|
||||||
not ok 8 - messages() # TODO Received a fatal error.
|
not ok 7 - messages() # TODO Received a fatal error.
|
||||||
---
|
---
|
||||||
# Received a fatal error.
|
# Received a fatal error.
|
||||||
at: tst_Blacklisted::messages() (Unknown file:0)
|
at: tst_Blacklisted::messages() (Unknown file:0)
|
||||||
file: Unknown file
|
file: Unknown file
|
||||||
line: 0
|
line: 0
|
||||||
...
|
...
|
||||||
1..8
|
1..7
|
||||||
# tests 8
|
# tests 7
|
||||||
# pass 1
|
# pass 1
|
||||||
# fail 0
|
# fail 0
|
||||||
|
@ -22,5 +22,5 @@ INFO : tst_Blacklisted::messages() This is an internal testlib info message th
|
|||||||
QFATAL : tst_Blacklisted::messages() This is a fatal error message that should still appear in silent test output
|
QFATAL : tst_Blacklisted::messages() This is a fatal error message that should still appear in silent test output
|
||||||
BFAIL : tst_Blacklisted::messages() Received a fatal error.
|
BFAIL : tst_Blacklisted::messages() Received a fatal error.
|
||||||
Loc: [Unknown file(0)]
|
Loc: [Unknown file(0)]
|
||||||
Totals: 1 passed, 0 failed, 1 skipped, 6 blacklisted, 0ms
|
Totals: 1 passed, 0 failed, 1 skipped, 5 blacklisted, 0ms
|
||||||
********* Finished testing of tst_Blacklisted *********
|
********* Finished testing of tst_Blacklisted *********
|
||||||
|
Loading…
x
Reference in New Issue
Block a user