diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2016-11-01 17:43:37 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2016-11-08 10:11:56 +0000 |
commit | d0516e847335e7f432f137bf4774a05b0c007569 (patch) | |
tree | 6df238a585bca5f7fd827d8d2b3cd8e21f686ad0 /tests/auto/blackbox/testdata | |
parent | ebac3b42903486830e1fd8935981ff3a32e9de1a (diff) |
Executor: Fix dynamic rules with generated inputsv1.6.1
This has never worked, as the condition that was supposed to collect
such inputs always evaluated to false.
Task-number: QBS-1029
Change-Id: Idf3f86f12fa050a3d151f4551821bf4395f715d8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata')
-rw-r--r-- | tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/input.txt | 1 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/input.txt b/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/input.txt new file mode 100644 index 000000000..37081c649 --- /dev/null +++ b/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/input.txt @@ -0,0 +1 @@ +old.txt diff --git a/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs b/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs new file mode 100644 index 000000000..725966c3b --- /dev/null +++ b/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs @@ -0,0 +1,50 @@ +import qbs +import qbs.File +import qbs.TextFile + +Product { + type: ["mytype.final"] + + Group { + files: ["input.txt"] + fileTags: ["mytype.in"] + } + + Rule { + inputs: ["mytype.in"] + Artifact { + filePath: "output.txt" + fileTags: ["mytype.out"] + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; + return [cmd]; + } + } + + Rule { + inputs: ["mytype.out"] + outputFileTags: ["mytype.final"] + outputArtifacts: { + var file; + var inFile = new TextFile(input.filePath, TextFile.ReadOnly); + try { + file = inFile.readLine(); + if (!file) + throw "no file name found"; + } finally { + inFile.close(); + } + return [{ filePath: file, fileTags: ["mytype.final"] }]; + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; + return [cmd]; + } + } +} + |