diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-08-01 15:17:17 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-08-05 03:58:50 +0200 |
commit | a71b9c937719bc3a5f4de6e91dbdbe364df38cac (patch) | |
tree | 59bb257170db1fe118c158d44e48a35763afeac1 /tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp | |
parent | c95d7741b74bc617d86297dbfa5cd7d1df98f8c3 (diff) |
testlib: Clean up tst_blacklist
33d7f76f0e847d7e0fb00dd6056e7bba45b8b1e7 attempted to exercise more
of the blacklisting code, but in doing so didn't account for the
fact that the features it added didn't actually work.
Adding a global blacklisting of * will result in blacklisting
all tests, regardless of any inverse conditions "!*" later on,
such as for the 'pass' test. This would have been evident by
looking at the expectation files, which still showed the test
as a BPASS.
The broken feature should be fixed, but in the meantime let's
clean up the test so it doesn't misrepresent reality.
At the same time we also remove the messages() tests, which was
copied straight out of tst_silent, but doesn't serve any purpose
for the blacklist selftest.
Pick-to: 6.2
Change-Id: I20e4693300aad5e9ff5f17ad22e3dfcb5c49fd0e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp')
-rw-r--r-- | tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp index 86f445b926..0ac6ae19f4 100644 --- a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp +++ b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp @@ -40,13 +40,9 @@ private slots: void fail(); void xfail(); void xpass(); - - // This test function must be last, as it calls qFatal(). - void messages(); }; -// All the tests below except pass() have been blacklisted in blacklisted/BLACKLIST -// Contrast with ../silent/, for the same tests without blacklisting but with -silent +// All the tests below have been blacklisted in blacklisted/BLACKLIST void tst_Blacklisted::pass() { @@ -75,35 +71,5 @@ void tst_Blacklisted::xpass() QVERIFY2(true, "This test should BXPASS"); } -#ifndef Q_OS_WIN -#include <signal.h> -#include <setjmp.h> - -static jmp_buf state; -static void abort_handler(int) -{ - longjmp(state, 1); -} -#endif - -void tst_Blacklisted::messages() -{ - qWarning("This is a warning that should not appear in silent test output"); - QTestLog::warn("This is an internal testlib warning that should not appear in silent test output", __FILE__, __LINE__); - qDebug("This is a debug message that should not appear in silent test output"); - qCritical("This is a critical message that should not appear in silent test output"); - qInfo("This is an info message that should not appear in silent test output"); - QTestLog::info("This is an internal testlib info message that should not appear in silent test output", __FILE__, __LINE__); - -#ifndef Q_OS_WIN - // We're testing qFatal, but we don't want to actually std::abort() ! - auto prior = signal(SIGABRT, abort_handler); - if (setjmp(state)) - signal(SIGABRT, prior); - else -#endif - qFatal("This is a fatal error message that should still appear in silent test output"); -} - QTEST_MAIN(tst_Blacklisted) #include "tst_blacklisted.moc" |