diff options
Diffstat (limited to 'tests/auto/quick/qmltests/tst_qmltests.cpp')
-rw-r--r-- | tests/auto/quick/qmltests/tst_qmltests.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/tst_qmltests.cpp b/tests/auto/quick/qmltests/tst_qmltests.cpp index ba7a992db..d70a43895 100644 --- a/tests/auto/quick/qmltests/tst_qmltests.cpp +++ b/tests/auto/quick/qmltests/tst_qmltests.cpp @@ -27,8 +27,10 @@ ****************************************************************************/ #include <QtCore/QScopedPointer> +#include <QTemporaryDir> #include <QtQuickTest/quicktest.h> #include <QtWebEngine/QQuickWebEngineProfile> +#include <QQmlEngine> #include "qt_webengine_quicktest.h" #if defined(Q_OS_LINUX) && defined(QT_DEBUG) @@ -95,6 +97,19 @@ static void sigSegvHandler(int signum) } #endif +class TempDir : public QObject { + Q_OBJECT + +public: + Q_INVOKABLE QString path() { + Q_ASSERT(tempDir.isValid()); + return tempDir.isValid() ? tempDir.path() : QString(); + } + +private: + QTemporaryDir tempDir; +}; + int main(int argc, char **argv) { #if defined(Q_OS_LINUX) && defined(QT_DEBUG) @@ -127,9 +142,12 @@ int main(int argc, char **argv) } QtWebEngine::initialize(); QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true); + qmlRegisterType<TempDir>("Test.util", 1, 0, "TempDir"); QTEST_SET_MAIN_SOURCE_PATH int i = quick_test_main(argc, argv, "qmltests", QUICK_TEST_SOURCE_DIR); return i; } + +#include "tst_qmltests.moc" |