aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-20 17:16:01 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-11-23 05:36:25 +0000
commitd28c9f6abb7311f75a182309ad2b3e875fd6ba59 (patch)
tree9850a98a92767a6a3d3730b8dfeee1eb6cd787cd /tests/auto
parent88edd02b2bf872af5348531d05a47d7e15a61702 (diff)
Make sure the appropriate import versions are always available
Utilize the newly introduced qmlRegisterModule() to automatically register the import version that matches the Qt version that is used to build the module. Now we can remove the artificial qmlRegisterRevision() calls, which were added just to make certain import versions available, even if there was no such revision. Change-Id: Ic3887c221c69b6cd299853d8d5869b8af7a314ec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/revisions/tst_revisions.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/auto/revisions/tst_revisions.cpp b/tests/auto/revisions/tst_revisions.cpp
index 33649d62..ef1eb1f9 100644
--- a/tests/auto/revisions/tst_revisions.cpp
+++ b/tests/auto/revisions/tst_revisions.cpp
@@ -52,12 +52,9 @@ void tst_revisions::revisions_data()
{
QTest::addColumn<int>("revision");
- // In theory, this could be done in a loop from 5.7 to QT_VERSION, but
- // the test would immediately fail when the Qt version was bumped up.
- // Therefore it is better to just add these lines by hand when adding
- // new revisions.
- QTest::newRow("2.0") << 0; // Qt 5.7
- QTest::newRow("2.1") << 1; // Qt 5.8
+ // Qt 5.7: 2.0, Qt 5.8: 2.1, Qt 5.9: 2.2...
+ for (int i = 0; i <= QT_VERSION_MINOR - 7; ++i)
+ QTest::newRow(qPrintable(QString("2.%1").arg(i))) << i;
}
void tst_revisions::revisions()
@@ -67,6 +64,7 @@ void tst_revisions::revisions()
QQmlEngine engine;
QQmlComponent component(&engine);
component.setData(QString("import QtQuick 2.0; \
+ import QtQuick.Templates 2.%1 as T; \
import QtQuick.Controls 2.%1; \
import QtQuick.Controls.impl 2.%1; \
import QtQuick.Controls.Material 2.%1; \