diff options
Diffstat (limited to 'tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs')
-rw-r--r-- | tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs b/tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs new file mode 100644 index 000000000..672576263 --- /dev/null +++ b/tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs @@ -0,0 +1,71 @@ +import qbs +import qbs.File +import qbs.TextFile +import "util.js" as Utils + +Product { + type: ["final1", "final2"] + Group { + files: ["dummy1.input"] + fileTags: ["input1"] + } + Group { + files: ["dummy2.input"] + fileTags: ["input2"] + } + Rule { + inputs: ["input1"] + Artifact { + filePath: project.buildDirectory + "/dummy1.final" + fileTags: ["final1"] + } + prepare: { + var cmds = []; + for (var i = 0; i < 10; ++i) { + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.createFile = i == 9; + cmd.sourceCode = function() { + if (createFile) { + print("Creating file"); + var file = new TextFile(output.filePath, TextFile.WriteOnly); + file.close(); + } + }; + cmds.push(cmd); + } + return cmds; + } + } + Rule { + inputs: ["input2"] + Artifact { + filePath: "dummy.intermediate" + fileTags: ["intermediate"] + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.sourceCode = function() { }; + return [cmd]; + } + } + Rule { + inputs: ["intermediate"] + Artifact { + filePath: "dummy2.final" + fileTags: ["final2"] + } + prepare: { + do + Utils.sleep(6000); + while (!File.exists(project.buildDirectory + "/dummy1.final")); + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.sourceCode = function() { }; + return [cmd]; + } + } +} + + |