diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-05-11 10:13:39 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-05-14 08:36:14 +0000 |
commit | 3512a8cd5a2be336f610ec2334185e525af46b65 (patch) | |
tree | 1b5c40f8d649376e27541867cc13115c99365f75 /tests | |
parent | 2bda52aa3d50deb56128f42395ae9f2686af2a99 (diff) |
Properly handle Depends.profiles
... when adjusting dependencies for multiplexing. If the profiles
property is set, it must override our heuristic about which variant of
the dependency to use.
Change-Id: I207dd6cdee91fb2715b5abcd634573f850f14404
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs | 58 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/multiplexed-tool/tool.cpp | 8 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 7 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.h | 1 |
4 files changed, 74 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs b/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs new file mode 100644 index 000000000..b36ea5be9 --- /dev/null +++ b/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs @@ -0,0 +1,58 @@ +import qbs + +Project { + CppApplication { + name: "tool" + consoleApplication: true + Profile { + name: "debugProfile" + qbs.buildVariant: "debug" + } + Profile { + name: "releaseProfile" + qbs.buildVariant: "release" + } + multiplexByQbsProperties: "profiles" + qbs.profiles: ["debugProfile", "releaseProfile"] + files: "tool.cpp" + Properties { + condition: qbs.buildVariant === "debug" + cpp.defines: "WRONG_VARIANT" + } + Export { + Rule { + multiplex: true + inputsFromDependencies: "application" + Artifact { + filePath: "tool.out" + fileTags: "tool.output" + } + prepare: { + var cmd = new Command(input.filePath, []); + cmd.description = "creating " + output.fileName; + return cmd; + } + } + } + } + Product { + name: "p" + type: "tool.output" + multiplexByQbsProperties: "buildVariants" + qbs.buildVariants: ["debug", "release"] + Depends { name: "tool"; profiles: "releaseProfile" } + } + Product { + name: "p2" + type: "tool.output" + multiplexByQbsProperties: "buildVariants" + qbs.buildVariants: ["debug", "release"] + Depends { name: "helper" } + } + Product { + name: "helper" + Export { + Depends { name: "tool"; profiles: "releaseProfile" } + } + } +} diff --git a/tests/auto/blackbox/testdata/multiplexed-tool/tool.cpp b/tests/auto/blackbox/testdata/multiplexed-tool/tool.cpp new file mode 100644 index 000000000..ac2e22ed9 --- /dev/null +++ b/tests/auto/blackbox/testdata/multiplexed-tool/tool.cpp @@ -0,0 +1,8 @@ +#include <cstdlib> + +int main() +{ +#ifdef WRONG_VARIANT + return EXIT_FAILURE; +#endif +} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 6ef0acaba..826884f08 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -4138,6 +4138,13 @@ void TestBlackbox::multipleConfigurations() QCOMPARE(m_qbsStdout.count("compiling main.cpp"), 3); } +void TestBlackbox::multiplexedTool() +{ + QDir::setCurrent(testDataDir + "/multiplexed-tool"); + QCOMPARE(runQbs(), 0); + QCOMPARE(m_qbsStdout.count("creating tool.out"), 4); +} + void TestBlackbox::nestedGroups() { QDir::setCurrent(testDataDir + "/nested-groups"); diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 91a177063..2646704f9 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -168,6 +168,7 @@ private slots: void movedFileDependency(); void multipleChanges(); void multipleConfigurations(); + void multiplexedTool(); void nestedGroups(); void nestedProperties(); void newOutputArtifact(); |