aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata
diff options
context:
space:
mode:
authorOla Røer Thorsen <ola@silentwings.no>2019-01-02 15:24:01 +0100
committerOla Røer Thorsen <ola@silentwings.no>2019-01-03 13:22:42 +0000
commita25b4897469a6c1e38eba22f7c615e247efe02d9 (patch)
tree64b112c06237d2a92f9b12319949a8933e423a86 /tests/auto/blackbox/testdata
parent83c43258e0a8f7e45808ecdf60b49938413c85bf (diff)
Add atEnd() function to the Process service
This makes it possible to use readLine in a while loop until the complete stream is read, even when reading empty lines. [ChangeLog] Added atEnd() function to the Process service, to make it possible to use readLine() in a while loop until the complete stream is read. Change-Id: Ie5f047651977195d6a93c4575bd7a8796b83ab5d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata')
-rw-r--r--tests/auto/blackbox/testdata/jsextensions-process/process.qbs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/jsextensions-process/process.qbs b/tests/auto/blackbox/testdata/jsextensions-process/process.qbs
index be9e718df..eba95d005 100644
--- a/tests/auto/blackbox/testdata/jsextensions-process/process.qbs
+++ b/tests/auto/blackbox/testdata/jsextensions-process/process.qbs
@@ -61,6 +61,24 @@ Project {
output.write(process.readStdOut());
process.close();
+ // readLine and atEnd
+ var testReadlineFile = new TextFile("123.txt", TextFile.WriteOnly);
+ testReadlineFile.writeLine("1");
+ testReadlineFile.writeLine("2");
+ testReadlineFile.writeLine("3");
+ testReadlineFile.close();
+
+ process = new Process();
+ if (product.qbs.hostOS.contains("windows"))
+ process.exec(product.qbs.windowsShellPath,
+ ["/C", "type", "123.txt"],
+ true);
+ else
+ process.exec("cat", ["123.txt"], true);
+
+ while(!process.atEnd())
+ output.write(process.readLine());
+
// TODO: Test all the other Process methods as well.
output.close();