aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-06-01 17:35:04 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-06-05 07:34:56 +0000
commit9c79f93d68baee8ed98e7cad81253f29e529a3a3 (patch)
tree91107f80bac3ceb57e82b81154765cad465ddecc /tests
parentb3e1e3e3b307e60924dcf3cf308488a362de88f0 (diff)
Fix the qmlcachegen functionality
The qmlcache module was broken in an impressive number of ways: - We forgot to adapt the Probe to a5cc49f2c6. - The return value of the validate property is never evaluated; you have to throw an error for it to have an effect. - From 5.11 on, qmlcachegen does not support the --target-architecture option anymore. Task-number: QBS-1353 Change-Id: I770ddc18ad2519c1d5db83bee9634717b1768d67 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs10
-rw-r--r--tests/auto/blackbox/tst_blackboxqt.cpp6
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs b/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs
index 398d3f4a9..5117557e1 100644
--- a/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs
+++ b/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs
@@ -1,4 +1,5 @@
import qbs
+import qbs.Utilities
CppApplication {
name: "app"
@@ -27,4 +28,13 @@ CppApplication {
qbs.install: true
qbs.installDir: "data"
}
+
+ Probe {
+ id: qtVersionProbe
+ property string qtVersion: Qt.core.version
+ configure: {
+ console.info("qmlcachegen must work: "
+ + (Utilities.versionCompare(qtVersion, "5.11") >= 0))
+ }
+ }
}
diff --git a/tests/auto/blackbox/tst_blackboxqt.cpp b/tests/auto/blackbox/tst_blackboxqt.cpp
index 93eb68f80..03e52590b 100644
--- a/tests/auto/blackbox/tst_blackboxqt.cpp
+++ b/tests/auto/blackbox/tst_blackboxqt.cpp
@@ -77,7 +77,11 @@ void TestBlackboxQt::cachedQml()
QDir::setCurrent(testDataDir + "/cached-qml");
QCOMPARE(runQbs(), 0);
QString dataDir = relativeBuildDir() + "/install-root/data";
- if (QFile::exists(dataDir + "/main.cpp")) {
+ QVERIFY2(m_qbsStdout.contains("qmlcachegen must work: true")
+ || m_qbsStdout.contains("qmlcachegen must work: false"),
+ m_qbsStdout.constData());
+ if (m_qbsStdout.contains("qmlcachegen must work: false")
+ && QFile::exists(dataDir + "/main.cpp")) {
// If C++ source files were installed then Qt.qmlcache is not available. See project file.
QSKIP("No QML cache files generated.");
}