summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/skipcleanup
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-07-11 14:27:28 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2022-07-25 19:29:07 +0200
commit21e9c223b753ade33c994c1efabbd67978eda3bf (patch)
treedeb3f79829a12f43b4f52111fd37139aa5f0479d /tests/auto/testlib/selftests/skipcleanup
parentafbae9c2acf8d5c0846a87f03edfb9407672e9ee (diff)
Test skip and fail in cleanup() as well as in cleanupTestCase()
The skipcleanup and failcleanup tests were actually testing skip and fail in cleanupTestCase(), not in cleanup(). Add almost-duplicate tests and clean up so that we now have {fail,skip}cleanup(,testcase} tests to cover all four cases. Generated expected output. The new tests (with old names) get their fail or skip - during cleanup() - reported against the test instead of the cleanupTestCase function. (Results for {init,cleanup}TestCase() are always reported, even when these slots are not defined, as no-op passes.) Pick-to: 6.4 Change-Id: I0988d1696b50c0e2f30c45ddc25e1bd0bfd2151a Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/testlib/selftests/skipcleanup')
-rw-r--r--tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt8
-rw-r--r--tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp6
2 files changed, 5 insertions, 9 deletions
diff --git a/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt b/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt
index 5af361e25a..b977c2ba3e 100644
--- a/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt
+++ b/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt
@@ -1,12 +1,10 @@
-# Generated from skipcleanup.pro.
-
#####################################################################
## skipcleanup Binary:
#####################################################################
qt_internal_add_executable(skipcleanup
- NO_INSTALL # special case
- OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case
+ NO_INSTALL
+ OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES
tst_skipcleanup.cpp
PUBLIC_LIBRARIES
@@ -16,6 +14,4 @@ qt_internal_add_executable(skipcleanup
## Scopes:
#####################################################################
-# special case begin
qt_internal_apply_testlib_coverage_options(skipcleanup)
-# special case end
diff --git a/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp b/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp
index 1afe9a5c57..568609663a 100644
--- a/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp
+++ b/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp
@@ -8,7 +8,7 @@ class tst_SkipCleanup: public QObject
Q_OBJECT
private slots:
void aTestFunction() const;
- void cleanupTestCase() const;
+ void cleanup() const;
};
void tst_SkipCleanup::aTestFunction() const
@@ -16,9 +16,9 @@ void tst_SkipCleanup::aTestFunction() const
QVERIFY(true);
}
-void tst_SkipCleanup::cleanupTestCase() const
+void tst_SkipCleanup::cleanup() const
{
- QSKIP("Skip inside cleanupTestCase.");
+ QSKIP("Skip inside cleanup.");
}
QTEST_APPLESS_MAIN(tst_SkipCleanup)