From d28c9f6abb7311f75a182309ad2b3e875fd6ba59 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 20 Oct 2016 17:16:01 +0200 Subject: 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 --- tests/auto/revisions/tst_revisions.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tests/auto/revisions') 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("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; \ -- cgit v1.2.3