OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // Windows doesn't support sending signals. | 5 // Windows doesn't support sending signals. |
6 @TestOn("vm && !windows") | 6 @TestOn("vm && !windows") |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 var test = _runTest(["test.dart"]); | 245 var test = _runTest(["test.dart"]); |
246 test.stdout.expect(consumeThrough("running test")); | 246 test.stdout.expect(consumeThrough("running test")); |
247 signalAndQuit(test); | 247 signalAndQuit(test); |
248 | 248 |
249 d.file("output", "true").validate(); | 249 d.file("output", "true").validate(); |
250 expectTempDirEmpty(); | 250 expectTempDirEmpty(); |
251 }); | 251 }); |
252 }); | 252 }); |
253 } | 253 } |
254 | 254 |
255 ScheduledProcess _runTest(List<String> args) => | 255 ScheduledProcess _runTest(List<String> args, {bool forwardStdio: false}) => |
256 runTest(args, environment: {"_UNITTEST_TEMP_DIR": _tempDir}); | 256 runTest(args, |
| 257 environment: {"_UNITTEST_TEMP_DIR": _tempDir}, |
| 258 forwardStdio: forwardStdio); |
257 | 259 |
258 void signalAndQuit(ScheduledProcess test) { | 260 void signalAndQuit(ScheduledProcess test) { |
259 test.signal(ProcessSignal.SIGTERM); | 261 test.signal(ProcessSignal.SIGTERM); |
260 test.shouldExit(); | 262 test.shouldExit(); |
261 test.stderr.expect(isDone); | 263 test.stderr.expect(isDone); |
262 } | 264 } |
263 | 265 |
264 void expectTempDirEmpty() { | 266 void expectTempDirEmpty() { |
265 schedule(() => expect(new Directory(_tempDir).listSync(), isEmpty)); | 267 schedule(() => expect(new Directory(_tempDir).listSync(), isEmpty)); |
266 } | 268 } |
OLD | NEW |