| 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 import 'dart:platform' as platform; |
| 10 | 11 |
| 11 import 'package:path/path.dart' as path; | 12 import 'package:path/path.dart' as path; |
| 12 import 'package:scheduled_test/scheduled_process.dart'; | 13 import 'package:scheduled_test/scheduled_process.dart'; |
| 13 import 'package:scheduled_test/scheduled_test.dart'; | 14 import 'package:scheduled_test/scheduled_test.dart'; |
| 14 | 15 |
| 15 import 'metatest.dart'; | 16 import 'metatest.dart'; |
| 16 import 'utils.dart'; | 17 import 'utils.dart'; |
| 17 | 18 |
| 18 void main(List<String> args, message) { | 19 void main(_, message) { |
| 19 metaTestInit(message); | 20 initMetatest(message); |
| 20 | 21 |
| 21 setUpTimeout(); | 22 setUpTimeout(); |
| 22 | 23 |
| 23 expectTestsPass("a process must have kill() or shouldExit() called", () { | 24 expectTestsPass("a process must have kill() or shouldExit() called", () { |
| 24 var errors; | 25 var errors; |
| 25 test('test 1', () { | 26 test('test 1', () { |
| 26 currentSchedule.onException.schedule(() { | 27 currentSchedule.onException.schedule(() { |
| 27 errors = currentSchedule.errors; | 28 errors = currentSchedule.errors; |
| 28 }); | 29 }); |
| 29 | 30 |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 }); | 383 }); |
| 383 }, 'write script file'); | 384 }, 'write script file'); |
| 384 | 385 |
| 385 currentSchedule.onComplete.schedule(() { | 386 currentSchedule.onComplete.schedule(() { |
| 386 return tempDir.catchError((_) => null).then((dir) { | 387 return tempDir.catchError((_) => null).then((dir) { |
| 387 if (dir == null) return; | 388 if (dir == null) return; |
| 388 return new Directory(dir).delete(recursive: true); | 389 return new Directory(dir).delete(recursive: true); |
| 389 }); | 390 }); |
| 390 }, 'clean up temp dir'); | 391 }, 'clean up temp dir'); |
| 391 | 392 |
| 392 return new ScheduledProcess.start(dartExecutable, ['--checked', dartPath]); | 393 return new ScheduledProcess.start(platform.executable, |
| 394 ['--checked', dartPath]); |
| 393 } | 395 } |
| OLD | NEW |