diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2022-01-26 11:03:28 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-03 05:49:25 +0000 |
commit | aba15fe6c7de9bede7ac70e2b74cae2df1c00c1d (patch) | |
tree | 268e6709de8d24d7e97e00aa92c3501114b83686 | |
parent | bd8a21e752b0c6e3e006edc6e157c90e2c3a9439 (diff) |
Skip tests that call qmlcachegen when cross-compiled
qmlcachegen is not meant to be available on the target.
Fixes: QTBUG-100366
Change-Id: I5cbaa62e85d9a5dd6467840eb4e3ba5e3b63857c
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit d245985f0b7aa698be2bd9c196fd7b9299aa5693)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | tests/auto/qml/qmlcachegen/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 48 |
2 files changed, 53 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcachegen/CMakeLists.txt b/tests/auto/qml/qmlcachegen/CMakeLists.txt index 9eaa2ea642..7f22c14f92 100644 --- a/tests/auto/qml/qmlcachegen/CMakeLists.txt +++ b/tests/auto/qml/qmlcachegen/CMakeLists.txt @@ -153,3 +153,8 @@ qt_internal_extend_target(tst_qmlcachegen CONDITION NOT ANDROID AND NOT IOS DEFINES QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" ) + +qt_internal_extend_target(tst_qmlcachegen CONDITION CMAKE_CROSSCOMPILING + DEFINES + QTEST_CROSS_COMPILED +) diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index 70b1c259e1..51bb45db11 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -114,6 +114,10 @@ public: static bool generateCache(const QString &qmlFileName, QByteArray *capturedStderr = nullptr) { +#if defined(QTEST_CROSS_COMPILED) + QTest::qFail("You cannot call qmlcachegen on the target.", __FILE__, __LINE__); + return false; +#endif QProcess proc; if (capturedStderr == nullptr) proc.setProcessChannelMode(QProcess::ForwardedChannels); @@ -152,6 +156,10 @@ void tst_qmlcachegen::initTestCase() void tst_qmlcachegen::loadGeneratedFile() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QTemporaryDir tempDir; QVERIFY(tempDir.isValid()); @@ -214,6 +222,10 @@ public: void tst_qmlcachegen::translationExpressionSupport() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QTemporaryDir tempDir; QVERIFY(tempDir.isValid()); @@ -259,6 +271,10 @@ void tst_qmlcachegen::translationExpressionSupport() void tst_qmlcachegen::signalHandlerParameters() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QTemporaryDir tempDir; QVERIFY(tempDir.isValid()); @@ -322,6 +338,10 @@ void tst_qmlcachegen::signalHandlerParameters() void tst_qmlcachegen::errorOnArgumentsInSignalHandler() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QTemporaryDir tempDir; QVERIFY(tempDir.isValid()); @@ -347,6 +367,10 @@ void tst_qmlcachegen::errorOnArgumentsInSignalHandler() void tst_qmlcachegen::aheadOfTimeCompilation() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QTemporaryDir tempDir; QVERIFY(tempDir.isValid()); @@ -478,6 +502,10 @@ void tst_qmlcachegen::workerScripts() void tst_qmlcachegen::functionExpressions() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QTemporaryDir tempDir; QVERIFY(tempDir.isValid()); @@ -575,6 +603,10 @@ void tst_qmlcachegen::qrcScriptImport() void tst_qmlcachegen::fsScriptImport() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QTemporaryDir tempDir; QVERIFY(tempDir.isValid()); @@ -700,6 +732,10 @@ void tst_qmlcachegen::reproducibleCache_data() void tst_qmlcachegen::reproducibleCache() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QFETCH(QString, filePath); QFile file(filePath); @@ -731,6 +767,10 @@ void tst_qmlcachegen::parameterAdjustment() void tst_qmlcachegen::inlineComponent() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + QByteArray errors; bool ok = generateCache(testFile("inlineComponentWithId.qml"), &errors); QVERIFY2(ok, errors); @@ -744,6 +784,10 @@ void tst_qmlcachegen::inlineComponent() void tst_qmlcachegen::posthocRequired() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + bool ok = generateCache(testFile("posthocrequired.qml")); QVERIFY(ok); QQmlEngine engine; @@ -757,6 +801,10 @@ void tst_qmlcachegen::posthocRequired() void tst_qmlcachegen::scriptStringCachegenInteraction() { +#if defined(QTEST_CROSS_COMPILED) + QSKIP("Cannot call qmlcachegen on cross-compiled target."); +#endif + bool ok = generateCache(testFile("scriptstring.qml")); QVERIFY(ok); QQmlEngine engine; |