diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-07-16 10:53:19 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-07-17 10:57:50 +0000 |
commit | c9310e5eeb8af0af004653df51e919a28e4f992a (patch) | |
tree | 2f9a5e8ea248de791f9e0a38e232963726a57757 /tests/auto/blackbox/testdata | |
parent | 8570138c6bf62163a6e4392a61d20b1f2a71357e (diff) |
Fix change tracking edge case for when no outputs get created
Our change tracking information is stored per transformer. However, if
Rule.outputArtifacts returns an empty array, then no transformer gets
created. For this case, we need to "manually" force re-application of
the rule if properties of the input artifact have changed, in case
they've been accessed in the outputArtifacts script.
Change-Id: I0f2b8a9834f5268a282c775a945e240d3d1d9763
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata')
-rw-r--r-- | tests/auto/blackbox/testdata/input-tags-change-tracking/input-tags-change-tracking.qbs | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/tests/auto/blackbox/testdata/input-tags-change-tracking/input-tags-change-tracking.qbs b/tests/auto/blackbox/testdata/input-tags-change-tracking/input-tags-change-tracking.qbs index a312d9658..ef2c5c55b 100644 --- a/tests/auto/blackbox/testdata/input-tags-change-tracking/input-tags-change-tracking.qbs +++ b/tests/auto/blackbox/testdata/input-tags-change-tracking/input-tags-change-tracking.qbs @@ -3,17 +3,53 @@ import qbs.TextFile Product { name: "p" type: "p_tag" + property string generateInput Group { + condition: generateInput == "no" files: "input.txt" - fileTags: "txt" + fileTags: ["txt", "empty"] } Rule { + condition: generateInput == "static" + multiplex: true + Artifact { filePath: "input.txt"; fileTags: ["txt", "empty"] } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { + var out = new TextFile(output.filePath, TextFile.WriteOnly); + out.close(); + }; + return cmd; + } + } + Rule { + condition: generateInput == "dynamic" + multiplex: true + outputFileTags: ["txt", "empty"] + outputArtifacts: [{filePath: "input.txt", fileTags: ["txt", "empty"]}] + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { + var out = new TextFile(output.filePath, TextFile.WriteOnly); + out.close(); + }; + return cmd; + } + } + + Rule { inputs: "txt" outputFileTags: "p_tag" - outputArtifacts: [{ + outputArtifacts: { + if (input.fileTags.contains("empty")) + return []; + return [{ filePath: input.fileTags.contains("y") ? "y.out" : "x.out", fileTags: "p_tag" - }] + }] + } prepare: { var cmd = new JavaScriptCommand(); cmd.description = "generating " + output.fileName; |