diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-08-02 11:25:28 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-08-03 08:49:10 +0000 |
commit | ca66195afcad474bf98163a9fbae76a2c28cd865 (patch) | |
tree | 22069b9d2227ec1f9577f368a4895ee257c5ace2 /tests/auto/blackbox/testdata | |
parent | ffbc37129d6a2623ddc731520baba0f4d3b6f3b1 (diff) |
RulesApplicator: Fix possible assertion failure
The RuleNode class disconnects removed input artifacts, which could
break an assertion in the RulesApplicator in the case that a rule that
can provide different tags to the same artifact switches back and forth
between these tags. Fix this by re-establishing the connection between
output artifact and parent rule node if necessary.
Change-Id: I8d50190cba782ffe63d3a73b3d5400d95c99ea0e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata')
-rw-r--r-- | tests/auto/blackbox/testdata/retagged-output-artifact/retagged-output-artifact.qbs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/retagged-output-artifact/retagged-output-artifact.qbs b/tests/auto/blackbox/testdata/retagged-output-artifact/retagged-output-artifact.qbs new file mode 100644 index 000000000..8af84bcd7 --- /dev/null +++ b/tests/auto/blackbox/testdata/retagged-output-artifact/retagged-output-artifact.qbs @@ -0,0 +1,42 @@ +import qbs.File +import qbs.TextFile + +Product { + name: "p" + type: "p_type" + property bool useTag1 + Rule { + multiplex: true + outputFileTags: ["tag1", "tag2"] + outputArtifacts: [{filePath: "a1.txt", fileTags: product.useTag1 ? "tag1" : "tag2"}] + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.filePath; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + f.close(); + }; + return cmd; + } + } + Rule { + inputs: "tag1" + Artifact { filePath: "a2.txt"; fileTags: "p_type" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.filePath; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; + return cmd; + } + } + Rule { + inputs: "tag2" + Artifact { filePath: "a3.txt"; fileTags: "p_type" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.filePath; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; + return cmd; + } + } +} |