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 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // Cleanup test directory. | 87 // Cleanup test directory. |
88 dir.deleteSync(recursive: true); | 88 dir.deleteSync(recursive: true); |
89 }); | 89 }); |
90 // Drain out and err streams so they close. | 90 // Drain out and err streams so they close. |
91 process.stdout.listen((_) {}); | 91 process.stdout.listen((_) {}); |
92 process.stderr.listen((_) {}); | 92 process.stderr.listen((_) {}); |
93 }); | 93 }); |
94 future.catchError((error) { | 94 future.catchError((error) { |
95 dir.deleteSync(recursive: true); | 95 dir.deleteSync(recursive: true); |
96 Expect.fail(error.error.toString()); | 96 Expect.fail(error.toString()); |
97 }); | 97 }); |
98 } | 98 } |
99 | 99 |
100 // This tests that the Dart standalone VM can handle piping to stdin | 100 // This tests that the Dart standalone VM can handle piping to stdin |
101 // and can pipe to stdout. | 101 // and can pipe to stdout. |
102 main() { | 102 main() { |
103 // Don't try to run shell scripts on Windows. | 103 // Don't try to run shell scripts on Windows. |
104 var os = Platform.operatingSystem; | 104 var os = Platform.operatingSystem; |
105 if (os == 'windows') return; | 105 if (os == 'windows') return; |
106 | 106 |
(...skipping 11 matching lines...) Expand all Loading... |
118 } | 118 } |
119 | 119 |
120 // Run the shell script. | 120 // Run the shell script. |
121 test(shellScript.path, scriptFile.path, "0", false); | 121 test(shellScript.path, scriptFile.path, "0", false); |
122 test(shellScript.path, scriptFile.path, "0", true); | 122 test(shellScript.path, scriptFile.path, "0", true); |
123 test(shellScript.path, scriptFile.path, "1", false); | 123 test(shellScript.path, scriptFile.path, "1", false); |
124 test(shellScript.path, scriptFile.path, "1", true); | 124 test(shellScript.path, scriptFile.path, "1", true); |
125 test(shellScript.path, scriptFile.path, "2", false); | 125 test(shellScript.path, scriptFile.path, "2", false); |
126 test(shellScript.path, scriptFile.path, "2", true); | 126 test(shellScript.path, scriptFile.path, "2", true); |
127 } | 127 } |
OLD | NEW |