aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@qt.io>2022-01-26 11:03:28 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-03 08:45:43 +0000
commitb81a4a6e76970a330e255c57ed68e14694b25d41 (patch)
tree600b1f5e4a7d741617e52cb384362ffd09c1de53
parent6b2407e2d7b9e86c0380bec48456612af15810bd (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.txt5
-rw-r--r--tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp48
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 7ffcd2411b..a2639bc532 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());
@@ -464,6 +488,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());
@@ -561,6 +589,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());
@@ -686,6 +718,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);
@@ -717,6 +753,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);
@@ -729,6 +769,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;
@@ -740,6 +784,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;