| 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:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
| 11 import 'package:scheduled_test/scheduled_process.dart'; | 11 import 'package:scheduled_test/scheduled_process.dart'; |
| 12 import 'package:scheduled_test/scheduled_stream.dart'; | 12 import 'package:scheduled_test/scheduled_stream.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 'package:metatest/metatest.dart'; |
| 16 import 'utils.dart'; | 16 import 'utils.dart'; |
| 17 | 17 |
| 18 void main(_, message) { | 18 void main() => initTests(_test); |
| 19 |
| 20 void _test(message) { |
| 19 initMetatest(message); | 21 initMetatest(message); |
| 20 | 22 |
| 21 setUpTimeout(); | 23 setUpTimeout(); |
| 22 | 24 |
| 23 expectTestsPass("a process must have kill() or shouldExit() called", () { | 25 expectTestsPass("a process must have kill() or shouldExit() called", () { |
| 24 var errors; | 26 var errors; |
| 25 test('test 1', () { | 27 test('test 1', () { |
| 26 currentSchedule.onException.schedule(() { | 28 currentSchedule.onException.schedule(() { |
| 27 errors = currentSchedule.errors; | 29 errors = currentSchedule.errors; |
| 28 }); | 30 }); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 currentSchedule.onComplete.schedule(() { | 247 currentSchedule.onComplete.schedule(() { |
| 246 return tempDir.catchError((_) => null).then((dir) { | 248 return tempDir.catchError((_) => null).then((dir) { |
| 247 if (dir == null) return null; | 249 if (dir == null) return null; |
| 248 return new Directory(dir).delete(recursive: true); | 250 return new Directory(dir).delete(recursive: true); |
| 249 }); | 251 }); |
| 250 }, 'clean up temp dir'); | 252 }, 'clean up temp dir'); |
| 251 | 253 |
| 252 return new ScheduledProcess.start(Platform.executable, | 254 return new ScheduledProcess.start(Platform.executable, |
| 253 ['--checked', dartPath]); | 255 ['--checked', dartPath]); |
| 254 } | 256 } |
| OLD | NEW |