aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-05-04 09:09:51 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-05-07 07:40:07 +0000
commitc68c60c8a475f25d64c21f25223b8118f78dc1e3 (patch)
tree10cffd280c8dd2696daf355918d42b9cc4b0c9ab /tests
parent3096c93ded3ea0fff0c3b239982ab0d446f352a3 (diff)
ModuleLoader: Do dependency resolving in two stages
... if needed. This is required to lift the restriction that products cannot be matched by Depends.productTypes if their type depends on a module property, which turned out to be too limiting in practice. Change-Id: Ibc51f035209e583d335719560a69d5bb42cb6df9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/product-dependencies-by-type/modules/myconfig/myconfig.qbs5
-rw-r--r--tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs8
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp5
3 files changed, 16 insertions, 2 deletions
diff --git a/tests/auto/blackbox/testdata/product-dependencies-by-type/modules/myconfig/myconfig.qbs b/tests/auto/blackbox/testdata/product-dependencies-by-type/modules/myconfig/myconfig.qbs
new file mode 100644
index 000000000..f3d789842
--- /dev/null
+++ b/tests/auto/blackbox/testdata/product-dependencies-by-type/modules/myconfig/myconfig.qbs
@@ -0,0 +1,5 @@
+import qbs
+
+Module {
+ property bool typeDecider: true
+}
diff --git a/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs b/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs
index 73c9c695d..b5af509a0 100644
--- a/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs
+++ b/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs
@@ -24,6 +24,14 @@ Project {
name: "app3"
files: "main.cpp"
}
+ Product {
+ type: myconfig.typeDecider ? ["application"] : []
+ Depends { name: "cpp" }
+ Depends { name: "myconfig" }
+ consoleApplication: true
+ name: "app4"
+ files: "main.cpp"
+ }
CppApplication {
condition: false
consoleApplication: true
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 8fd6d347c..c3885b88f 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -4550,11 +4550,12 @@ void TestBlackbox::productDependenciesByType()
QFile appListFile(relativeProductBuildDir("app list") + "/app-list.txt");
QVERIFY2(appListFile.open(QIODevice::ReadOnly), qPrintable(appListFile.fileName()));
const QList<QByteArray> appList = appListFile.readAll().trimmed().split('\n');
- QCOMPARE(appList.size(), 3);
+ QCOMPARE(appList.size(), 4);
QStringList apps = QStringList()
<< QDir::currentPath() + '/' + relativeExecutableFilePath("app1")
<< QDir::currentPath() + '/' + relativeExecutableFilePath("app2")
- << QDir::currentPath() + '/' + relativeExecutableFilePath("app3");
+ << QDir::currentPath() + '/' + relativeExecutableFilePath("app3")
+ << QDir::currentPath() + '/' + relativeExecutableFilePath("app4");
for (const QByteArray &line : appList) {
const QString cleanLine = QString::fromLocal8Bit(line.trimmed());
QVERIFY2(apps.removeOne(cleanLine), qPrintable(cleanLine));