aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-07-04 11:59:19 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-07-04 11:04:23 +0000
commit75492633081511644d263b8a6e4ff494f78dc4bc (patch)
tree5d68d19124d83efba9351f97c375ae2b40688b96 /tests
parentea3a1191a5b89b8fe927409f3914eacd8bd748e5 (diff)
Fix false positive in property declaration checker
During export item merging, we lost the information about whether the property was setup by a Properties block. Change-Id: I899188b10aea66dfcfdb61e348d93be1f69347a3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/language/testdata/exports.qbs13
-rw-r--r--tests/auto/language/tst_language.cpp10
2 files changed, 22 insertions, 1 deletions
diff --git a/tests/auto/language/testdata/exports.qbs b/tests/auto/language/testdata/exports.qbs
index c480f0097..4c3a472c6 100644
--- a/tests/auto/language/testdata/exports.qbs
+++ b/tests/auto/language/testdata/exports.qbs
@@ -102,4 +102,17 @@ Project {
qbs.install: false
}
}
+
+ Product {
+ name: "dependency"
+ Export {
+ property bool depend: false
+ Depends { condition: depend; name: "cpp" }
+ Properties { condition: depend; cpp.includePaths: ["."] }
+ }
+ }
+ Product {
+ name: "depender"
+ Depends { name: "dependency" }
+ }
}
diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp
index 702621871..0c6be2902 100644
--- a/tests/auto/language/tst_language.cpp
+++ b/tests/auto/language/tst_language.cpp
@@ -726,7 +726,7 @@ void TestLanguage::exports()
TopLevelProjectPtr project = loader->loadProject(defaultParameters);
QVERIFY(!!project);
QHash<QString, ResolvedProductPtr> products = productsFromProject(project);
- QCOMPARE(products.count(), 17);
+ QCOMPARE(products.count(), 19);
ResolvedProductPtr product;
product = products.value("myapp");
QVERIFY(!!product);
@@ -812,6 +812,14 @@ void TestLanguage::exports()
propertyName = QStringList() << "modules" << "dummy" << "productName";
propertyValue = product->moduleProperties->property(propertyName);
QCOMPARE(propertyValue.toString(), QString("libE"));
+
+ product = products.value("depender");
+ QVERIFY(!!product);
+ QCOMPARE(product->modules.count(), 2);
+ for (const ResolvedModuleConstPtr &m : qAsConst(product->modules)) {
+ QVERIFY2(m->name == QString("qbs") || m->name == QString("dependency"),
+ qPrintable(m->name));
+ }
}
catch (const ErrorInfo &e) {
exceptionCaught = true;