| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library scheduled_process_test; | 5 library scheduled_process_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| 11 import 'package:path/path.dart' as path; | 11 import 'package:path/path.dart' as path; |
| 12 import 'package:scheduled_test/scheduled_process.dart'; | 12 import 'package:scheduled_test/scheduled_process.dart'; |
| 13 import 'package:scheduled_test/scheduled_test.dart'; | 13 import 'package:scheduled_test/scheduled_test.dart'; |
| 14 | 14 |
| 15 import 'metatest.dart'; | 15 import 'metatest.dart'; |
| 16 import 'utils.dart'; | 16 import 'utils.dart'; |
| 17 | 17 |
| 18 void main() { | 18 void main(List<String> args, message) { |
| 19 metaTestInit(message); |
| 20 |
| 19 setUpTimeout(); | 21 setUpTimeout(); |
| 20 | 22 |
| 21 expectTestsPass("a process must have kill() or shouldExit() called", () { | 23 expectTestsPass("a process must have kill() or shouldExit() called", () { |
| 22 var errors; | 24 var errors; |
| 23 test('test 1', () { | 25 test('test 1', () { |
| 24 currentSchedule.onException.schedule(() { | 26 currentSchedule.onException.schedule(() { |
| 25 errors = currentSchedule.errors; | 27 errors = currentSchedule.errors; |
| 26 }); | 28 }); |
| 27 | 29 |
| 28 startDartProcess('print("hello!");'); | 30 startDartProcess('print("hello!");'); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 384 |
| 383 currentSchedule.onComplete.schedule(() { | 385 currentSchedule.onComplete.schedule(() { |
| 384 return tempDir.catchError((_) => null).then((dir) { | 386 return tempDir.catchError((_) => null).then((dir) { |
| 385 if (dir == null) return; | 387 if (dir == null) return; |
| 386 return new Directory(dir).delete(recursive: true); | 388 return new Directory(dir).delete(recursive: true); |
| 387 }); | 389 }); |
| 388 }, 'clean up temp dir'); | 390 }, 'clean up temp dir'); |
| 389 | 391 |
| 390 return new ScheduledProcess.start(dartExecutable, ['--checked', dartPath]); | 392 return new ScheduledProcess.start(dartExecutable, ['--checked', dartPath]); |
| 391 } | 393 } |
| OLD | NEW |