summaryrefslogtreecommitdiff
path: root/tests/auto/language
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-03-13 10:09:57 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2018-03-13 10:13:12 +0000
commit6569fa173bf0476059f74023fd7bed1286c4b905 (patch)
treec6de40168f85bbaaed02b0ba6edd89392fee08d8 /tests/auto/language
parent5e5a71fef37fb64718aa17593dd909aabb784632 (diff)
downloadqbs-6569fa173bf0476059f74023fd7bed1286c4b905.tar.gz
Add autotest for exporting JavaScript objects from products
There is nothing special about this pattern, but we aren't using it anywhere at the moment, so let's verify it works. Change-Id: Ia7833bc9749110fb768072ed51e210e6ed6c2f7f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/language')
-rw-r--r--tests/auto/language/testdata/exports.qbs19
-rw-r--r--tests/auto/language/tst_language.cpp3
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/language/testdata/exports.qbs b/tests/auto/language/testdata/exports.qbs
index 83cb4f811..3f4e3cf49 100644
--- a/tests/auto/language/testdata/exports.qbs
+++ b/tests/auto/language/testdata/exports.qbs
@@ -109,8 +109,24 @@ Project {
Product {
name: "dependency"
+
+ Probe {
+ id: configProbe
+ property var config
+ configure: {
+ var obj = {};
+ obj.featureX = true;
+ obj.featureY = false;
+ obj.featureZ = true;
+ config = obj;
+ found = true;
+ }
+ }
+ property var config: configProbe.config
+
Export {
property bool depend: false
+ property var config: product.config
Depends { condition: depend; name: "cpp" }
Properties { condition: depend; cpp.includePaths: ["."] }
}
@@ -118,6 +134,9 @@ Project {
Product {
name: "depender"
Depends { name: "dependency" }
+ property bool featureX: dependency.config.featureX
+ property bool featureY: dependency.config.featureY
+ property bool featureZ: dependency.config.featureZ
}
Product {
diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp
index dd4d8d1aa..eda2e028a 100644
--- a/tests/auto/language/tst_language.cpp
+++ b/tests/auto/language/tst_language.cpp
@@ -963,6 +963,9 @@ void TestLanguage::exports()
QVERIFY2(m->name == QString("qbs") || m->name == QString("dependency"),
qPrintable(m->name));
}
+ QCOMPARE(product->productProperties.value("featureX"), true);
+ QCOMPARE(product->productProperties.value("featureY"), false);
+ QCOMPARE(product->productProperties.value("featureZ"), true);
product = products.value("broken_cycle3");
QVERIFY(!!product);