aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2023-08-28 09:37:35 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2023-08-31 11:01:27 +0000
commit9a74d56a32e0d041bf521598dadc898a4c7a07f6 (patch)
treeaefb3be03d86ec02922b3fc865e188e2d321b5aa
parentdbbb1ffa27f9f9836a295ac95a2accc87209e076 (diff)
Allow PropertyOptions within ModulesProvider items
Task-number: QBS-1748 Change-Id: Icfc55fa6e57cbfc32ccafbdbffb156e9405cb88e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/lib/corelib/language/builtindeclarations.cpp2
-rw-r--r--tests/auto/blackbox/testdata-providers/removal-version/module-providers/provider_a.qbs14
-rw-r--r--tests/auto/blackbox/testdata-providers/removal-version/removal-version.qbs12
-rw-r--r--tests/auto/blackbox/tst_blackboxproviders.cpp8
-rw-r--r--tests/auto/blackbox/tst_blackboxproviders.h1
5 files changed, 36 insertions, 1 deletions
diff --git a/src/lib/corelib/language/builtindeclarations.cpp b/src/lib/corelib/language/builtindeclarations.cpp
index 820ca9ff6..a2502685e 100644
--- a/src/lib/corelib/language/builtindeclarations.cpp
+++ b/src/lib/corelib/language/builtindeclarations.cpp
@@ -332,7 +332,7 @@ void BuiltinDeclarations::addModuleProviderItem()
<< PropertyDeclaration(StringConstants::moduleNameProperty(), PropertyDeclaration::String)
<< PropertyDeclaration(QStringLiteral("relativeSearchPaths"),
PropertyDeclaration::StringList);
- item.setAllowedChildTypes({ItemType::Probe});
+ item.setAllowedChildTypes({ItemType::PropertyOptions, ItemType::Probe});
insert(item);
}
diff --git a/tests/auto/blackbox/testdata-providers/removal-version/module-providers/provider_a.qbs b/tests/auto/blackbox/testdata-providers/removal-version/module-providers/provider_a.qbs
new file mode 100644
index 000000000..7f358acbc
--- /dev/null
+++ b/tests/auto/blackbox/testdata-providers/removal-version/module-providers/provider_a.qbs
@@ -0,0 +1,14 @@
+import "../../qbs-module-providers-helpers.js" as Helpers
+
+ModuleProvider {
+ isEager: false
+ property bool deprecated: false
+ PropertyOptions {
+ name: "deprecated"
+ removalVersion: "2.2.0"
+ }
+ relativeSearchPaths: {
+ Helpers.writeModule(outputBaseDir, moduleName, "from_provider_a");
+ return "";
+ }
+}
diff --git a/tests/auto/blackbox/testdata-providers/removal-version/removal-version.qbs b/tests/auto/blackbox/testdata-providers/removal-version/removal-version.qbs
new file mode 100644
index 000000000..1aa5e2ce9
--- /dev/null
+++ b/tests/auto/blackbox/testdata-providers/removal-version/removal-version.qbs
@@ -0,0 +1,12 @@
+Project {
+ qbsModuleProviders: "provider_a"
+ name: "project"
+ Project {
+ name: "innerProject"
+ Product {
+ name: "p1"
+ Depends { name: "qbsmetatestmodule" }
+ }
+ }
+
+}
diff --git a/tests/auto/blackbox/tst_blackboxproviders.cpp b/tests/auto/blackbox/tst_blackboxproviders.cpp
index 9d1c6d7d4..38bc42672 100644
--- a/tests/auto/blackbox/tst_blackboxproviders.cpp
+++ b/tests/auto/blackbox/tst_blackboxproviders.cpp
@@ -394,4 +394,12 @@ void TestBlackboxProviders::qbspkgconfigModuleProvider()
QCOMPARE(runQbs(params), 0);
}
+void TestBlackboxProviders::removalVersion()
+{
+ QDir::setCurrent(testDataDir + "/removal-version");
+ QCOMPARE(runQbs(), 0);
+ QVERIFY(m_qbsStderr.contains(
+ "Property 'deprecated' was scheduled for removal in version 2.2.0, but is still present"));
+}
+
QTEST_MAIN(TestBlackboxProviders)
diff --git a/tests/auto/blackbox/tst_blackboxproviders.h b/tests/auto/blackbox/tst_blackboxproviders.h
index 62dce9866..413df682d 100644
--- a/tests/auto/blackbox/tst_blackboxproviders.h
+++ b/tests/auto/blackbox/tst_blackboxproviders.h
@@ -57,6 +57,7 @@ private slots:
void qbsModuleProvidersCompatibility();
void qbsModuleProvidersCompatibility_data();
void qbspkgconfigModuleProvider();
+ void removalVersion();
};
#endif // TST_BLACKBOXPROVIDERS_H