aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-05-09 17:17:42 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-05-13 10:40:53 +0200
commit6d5de545c4e67289f973cf6ba9bdbbaeb4eb4a99 (patch)
tree275df0914bd1e47fc0120ce5da9857c4cf690e84 /tests/auto/blackbox/testdata
parent33f0e83c0cd2c2f149f2b03ac7cb4ba9dd22fb1a (diff)
Introduce sensible build directory values.
Currently, all products share the same build directory, and rules are responsible for making their artifact file paths unique, which is annoying for module authors and introduces lots of code duplication. Instead, make the product build directories unique and let these directories be the base directory of relative artifact file paths. Also export the top-level build dir as project.buildDirectory to the JavaScript side so rules can refer to that one if necessary. Task-number: QBS-567 Change-Id: I257d37cad01ec6dece3e214799b917149677d80c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/blackbox/testdata')
-rw-r--r--tests/auto/blackbox/testdata/build-directories/project.qbs42
-rw-r--r--tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs6
2 files changed, 45 insertions, 3 deletions
diff --git a/tests/auto/blackbox/testdata/build-directories/project.qbs b/tests/auto/blackbox/testdata/build-directories/project.qbs
new file mode 100644
index 000000000..871c7a5c1
--- /dev/null
+++ b/tests/auto/blackbox/testdata/build-directories/project.qbs
@@ -0,0 +1,42 @@
+import qbs
+
+Project {
+ Product {
+ name: "p1"
+ type: "blubb1"
+ Transformer {
+ Artifact {
+ fileName: "dummy1.txt"
+ fileTags: product.type
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.silent = true;
+ cmd.sourceCode = function() {
+ print(product.buildDirectory);
+ }
+ return cmd;
+ }
+ }
+ }
+ Product {
+ name: "p2"
+ type: "blubb2"
+ Depends { name: "p1" }
+ Transformer {
+ Artifact {
+ fileName: "dummy2.txt"
+ fileTags: product.type
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.silent = true;
+ cmd.sourceCode = function() {
+ print(product.buildDirectory);
+ print(project.buildDirectory);
+ }
+ return cmd;
+ }
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs
index bb1bcb03f..e0884cfac 100644
--- a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs
+++ b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs
@@ -59,12 +59,12 @@ Project {
var sourceFileName = options["outfile"] || "lex.yy.c";
var headerFileName = options["header-file"];
var result = [{
- filePath: "GeneratedFiles/" + product.name + "/" + sourceFileName,
+ filePath: "GeneratedFiles/" + sourceFileName,
fileTags: ["c"]
}];
if (headerFileName) {
result.push({
- filePath: "GeneratedFiles/" + product.name + "/" + headerFileName,
+ filePath: "GeneratedFiles/" + headerFileName,
fileTags: ["hpp"]
});
}
@@ -75,7 +75,7 @@ Project {
if (product.isFlexAvailable) {
// flex is available. Let's call it.
cmd = new Command("flex", [input.filePath]);
- cmd.workingDirectory = product.buildDirectory + "/GeneratedFiles/" + product.name;
+ cmd.workingDirectory = product.buildDirectory + "/GeneratedFiles";
} else {
// No flex available here, generate some C source and header.
cmd = new JavaScriptCommand();