diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2022-04-12 09:00:17 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2022-05-07 15:21:39 +0000 |
commit | f7d5361d4a1c7d6aaca318e859cd32f21af85702 (patch) | |
tree | 441f74e597c91953e44df009dd76d787904d71d5 /tests/auto/quick/qquickfontloader_static | |
parent | 3b91f86d89693f98a53037455695b036ac81d087 (diff) |
Use QTestLib logging for tst_qquickfontloader_static
The test so far did not actually use QTestLib, as it has to use multiple
instances of QGuiApplication. This however confuses CI, which looks for
the log file from the test. Fix this by recording the result of the
existing test function, and then checking it in a "normal" test.
Fixes: QTBUG-102446
Change-Id: Ifdd9a2e41fe1e752e8ca0350b8706b90132675c5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6d3f0d76167fe228896ba5c43ffa65e91f6479dc)
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickfontloader_static')
-rw-r--r-- | tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp b/tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp index 01cad92f86..34be2a8ca9 100644 --- a/tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp +++ b/tests/auto/quick/qquickfontloader_static/tst_qquickfontloader_static.cpp @@ -46,7 +46,7 @@ QByteArray qmltemplate("import QtQuick 2.0\n" " }\n" "}\n"); -int main(int argc, char **argv) +int actualTest(int argc, char **argv) { for (int i = 0; i < 3; i++) { QGuiApplication app(argc, argv); @@ -64,3 +64,25 @@ int main(int argc, char **argv) } return 0; } + +// we need the QTestLib infrastructure to create a log file +struct FontLoaderStaticTester : public QObject +{ + Q_OBJECT + +public: + int result = -1; +private slots: + void verify() { QCOMPARE(result, 0); } +}; + +int main(int argc, char **argv) +{ + int result = actualTest(argc, argv); + QCoreApplication app(argc, argv); + FontLoaderStaticTester tester; + tester.result = result; + QTest::qExec(&tester, argc, argv); +} + +#include "tst_qquickfontloader_static.moc" |