diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-08-26 12:41:19 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-08-26 11:30:46 +0000 |
commit | 817a292690ccdea7bae185319beb22ea653db946 (patch) | |
tree | 609fbf3d6781c60c6d00f77f6965a3410e4a4012 /tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs | |
parent | 94a097d95e9bfe485cebd7a5a9acd56301c54f04 (diff) |
Process Command: Do not needlessly interpret output as text
... when redirecting process output. Only do that if there is an output
filter function. Otherwise, we break redirection of binary data.
Fixes: QBS-1488
Change-Id: Ic5a1d2653fa8fc9c4f0eb5d31b7315d7aba3e030
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs')
-rw-r--r-- | tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs b/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs new file mode 100644 index 000000000..3ee443438 --- /dev/null +++ b/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs @@ -0,0 +1,38 @@ +import qbs.FileInfo + +Product { + name: "the-product" + type: "output" + Group { + files: "input.bin" + fileTags: "binary" + } + Group { + files: "input.txt" + fileTags: "text" + } + + Rule { + inputs: ["text", "binary"] + Artifact { + filePath: "output." + FileInfo.completeSuffix(input.filePath) + fileTags: "output" + } + prepare: { + var binary; + var prefixArgs; + if (product.qbs.hostOS.contains("windows")) { + binary = product.qbs.windowsShellPath; + prefixArgs = ["/c", "type"]; + } else { + binary = "cat"; + prefixArgs = []; + } + var inputPath = FileInfo.toNativeSeparators(input.filePath); + var cmd = new Command(binary, prefixArgs.concat([inputPath, inputPath])); + cmd.stdoutFilePath = output.filePath; + cmd.highlight = "filegen"; + return cmd; + } + } +} |