diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-05-07 12:24:02 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-05-16 07:28:50 +0000 |
commit | a0d3454e7b8d816f5bb5c76ed2e9d50ff6550485 (patch) | |
tree | 924065974118f0591475ec6271cbb7485ca860df /tests | |
parent | be8432fac97e701d3c7b7b45171f773ab33b9aae (diff) |
Make Depends.productTypes in Export items work
Change-Id: I441c0454ee7a4b928c132052c49db1cddc34d3c9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs | 55 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 7 |
2 files changed, 59 insertions, 3 deletions
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 f70f849b5..1297a3942 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 @@ -32,6 +32,54 @@ Project { name: "app4" files: "main.cpp" } + Product { + name: "other-product" + type: "other" + Rule { + multiplex: true + Artifact { + filePath: "output.txt" + fileTags: "other" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.filePath; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + } + return cmd; + } + } + Export { + Depends { productTypes: "other2" } + } + } + Product { + name: "yet-another-product" + type: "other2" + Rule { + multiplex: true + Artifact { + filePath: "output.txt" + fileTags: "other2" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.filePath; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + } + return cmd; + } + } + } + Product { + name: "helper" + Export { + Depends { productTypes: "other" } + } + } + CppApplication { condition: false consoleApplication: true @@ -57,11 +105,12 @@ Project { productTypes: ["application"] limitToSubProject: true } + Depends { name: "helper" } files: ["main.cpp"] Rule { multiplex: true - inputsFromDependencies: "application" + inputsFromDependencies: ["application", "other", "other2"] Artifact { filePath: "app-list.txt" fileTags: "app-list" @@ -73,6 +122,10 @@ Project { var file = new TextFile(output.filePath, TextFile.WriteOnly); for (var i = 0; i < inputs["application"].length; ++i) file.writeLine(inputs["application"][i].filePath); + for (i = 0; i < inputs["other"].length; ++i) + file.writeLine(inputs["other"][i].filePath); + for (i = 0; i < inputs["other2"].length; ++i) + file.writeLine(inputs["other2"][i].filePath); file.close(); }; return cmd; diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index adfde898e..93387e2f6 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -4557,12 +4557,15 @@ 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(), 4); + QCOMPARE(appList.size(), 6); QStringList apps = QStringList() << QDir::currentPath() + '/' + relativeExecutableFilePath("app1") << QDir::currentPath() + '/' + relativeExecutableFilePath("app2") << QDir::currentPath() + '/' + relativeExecutableFilePath("app3") - << QDir::currentPath() + '/' + relativeExecutableFilePath("app4"); + << QDir::currentPath() + '/' + relativeExecutableFilePath("app4") + << QDir::currentPath() + '/' + relativeProductBuildDir("other-product") + "/output.txt" + << QDir::currentPath() + '/' + relativeProductBuildDir("yet-another-product") + + "/output.txt"; for (const QByteArray &line : appList) { const QString cleanLine = QString::fromLocal8Bit(line.trimmed()); QVERIFY2(apps.removeOne(cleanLine), qPrintable(cleanLine)); |