aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/multiplexed-tool
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-05-11 10:13:39 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-05-14 08:36:14 +0000
commit3512a8cd5a2be336f610ec2334185e525af46b65 (patch)
tree1b5c40f8d649376e27541867cc13115c99365f75 /tests/auto/blackbox/testdata/multiplexed-tool
parent2bda52aa3d50deb56128f42395ae9f2686af2a99 (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/auto/blackbox/testdata/multiplexed-tool')
-rw-r--r--tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs58
-rw-r--r--tests/auto/blackbox/testdata/multiplexed-tool/tool.cpp8
2 files changed, 66 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
+}