Chromium Code Reviews| 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 /** | 5 /** |
| 6 * A simple unit test library for running tests on the VM. | 6 * A simple unit test library for running tests on the VM. |
| 7 */ | 7 */ |
| 8 library unittest_vm_config; | 8 library unittest_vm_config; |
| 9 | 9 |
| 10 import 'dart:async'; | |
| 10 import 'dart:io'; | 11 import 'dart:io'; |
| 11 import 'unittest.dart'; | 12 import 'unittest.dart'; |
| 12 | 13 |
| 13 class VMConfiguration extends Configuration { | 14 class VMConfiguration extends Configuration { |
| 14 void onDone(bool success) { | 15 void onDone(bool success) { |
| 15 try { | 16 try { |
| 16 super.onDone(success); | 17 super.onDone(success); |
| 17 exit(0); | 18 exit(0); |
|
Siggi Cherem (dart-lang)
2013/05/07 17:47:48
do you need to wait here too?
podivilov
2013/05/08 12:42:44
Usually you are not interested in the output of th
| |
| 18 } catch (ex) { | 19 } catch (ex) { |
| 19 // A non-zero exit code is used by the test infrastructure to detect | 20 Future.wait([stdout.close(), stderr.close()]).then((_) { |
| 20 // failure. | 21 // A non-zero exit code is used by the test infrastructure to detect |
| 21 exit(1); | 22 // failure. |
| 23 exit(1); | |
| 24 }); | |
| 22 } | 25 } |
| 23 } | 26 } |
| 24 } | 27 } |
| 25 | 28 |
| 26 void useVMConfiguration() { | 29 void useVMConfiguration() { |
| 27 unittestConfiguration = _singleton; | 30 unittestConfiguration = _singleton; |
| 28 } | 31 } |
| 29 | 32 |
| 30 final _singleton = new VMConfiguration(); | 33 final _singleton = new VMConfiguration(); |
| OLD | NEW |