OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // Test a dart sub-process handling stdio with different types of | 5 // Test a dart sub-process handling stdio with different types of |
6 // redirection. | 6 // redirection. |
7 // | 7 // |
8 // VMOptions= | 8 // VMOptions= |
9 // VMOptions=--short_socket_read | 9 // VMOptions=--short_socket_read |
10 // VMOptions=--short_socket_write | 10 // VMOptions=--short_socket_write |
11 // VMOptions=--short_socket_read --short_socket_write | 11 // VMOptions=--short_socket_read --short_socket_write |
12 | 12 |
13 import "package:expect/expect.dart"; | |
14 import "dart:io"; | 13 import "dart:io"; |
15 import "process_test_util.dart"; | 14 import "process_test_util.dart"; |
16 | 15 |
17 void checkFileEmpty(String fileName) { | 16 void checkFileEmpty(String fileName) { |
18 RandomAccessFile pipeOut = new File(fileName).openSync(); | 17 RandomAccessFile pipeOut = new File(fileName).openSync(); |
19 Expect.equals(0, pipeOut.lengthSync()); | 18 Expect.equals(0, pipeOut.lengthSync()); |
20 pipeOut.closeSync(); | 19 pipeOut.closeSync(); |
21 } | 20 } |
22 | 21 |
23 | 22 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 var scriptFile = new File("tests/standalone/io/process_std_io_script.dart"); | 94 var scriptFile = new File("tests/standalone/io/process_std_io_script.dart"); |
96 if (!scriptFile.existsSync()) { | 95 if (!scriptFile.existsSync()) { |
97 scriptFile = new File("../tests/standalone/io/process_std_io_script.dart"); | 96 scriptFile = new File("../tests/standalone/io/process_std_io_script.dart"); |
98 } | 97 } |
99 | 98 |
100 // Run the shell script. | 99 // Run the shell script. |
101 test(shellScript.path, scriptFile.path, "0"); | 100 test(shellScript.path, scriptFile.path, "0"); |
102 test(shellScript.path, scriptFile.path, "1"); | 101 test(shellScript.path, scriptFile.path, "1"); |
103 test(shellScript.path, scriptFile.path, "2"); | 102 test(shellScript.path, scriptFile.path, "2"); |
104 } | 103 } |
OLD | NEW |