aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qmltest/doc/src/qtquicktest-index.qdoc3
-rw-r--r--src/qmltest/quicktest.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/qmltest/doc/src/qtquicktest-index.qdoc b/src/qmltest/doc/src/qtquicktest-index.qdoc
index f641d8248f..700bddc8d5 100644
--- a/src/qmltest/doc/src/qtquicktest-index.qdoc
+++ b/src/qmltest/doc/src/qtquicktest-index.qdoc
@@ -157,6 +157,9 @@
\l {QQmlEngine::addPluginPath}{plugin paths},
and \l {QQmlFileSelector::setExtraSelectors}{extra file selectors}
will have been set on the engine by this point.
+ \li void cleanupTestCase()
+ \li Called right after the test execution has finished.
+ Use this function to clean up before everything will start to be destructed.
\endtable
Each function will be called once for each \c tst_*.qml file, so any
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index f2d5848d54..f666bc2284 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -588,6 +588,11 @@ int quick_test_main_with_setup(int argc, char **argv, const char *name, const ch
}
}
+ if (setup) {
+ // Don't check the return value; it's OK if it doesn't exist.
+ QMetaObject::invokeMethod(setup, "cleanupTestCase");
+ }
+
// Flush the current logging stream.
QuickTestResult::setProgramName(nullptr);
delete app;