Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Side by Side Diff: pkg/unittest/lib/vm_config.dart

Issue 12770017: pkg/unittest: config refactor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: per siggi's recomendations Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, 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:io'; 10 import 'dart:io';
11 import 'unittest.dart'; 11 import 'unittest.dart';
12 import 'package:meta/meta.dart';
13 12
14 class VMConfiguration extends Configuration { 13 class VMConfiguration extends Configuration {
15 void onDone(bool success) { 14 void onDone(bool success) {
16 try { 15 try {
17 super.onDone(success); 16 super.onDone(success);
18 exit(0); 17 exit(0);
19 } catch (ex) { 18 } catch (ex) {
20 // A non-zero exit code is used by the test infrastructure to detect 19 // A non-zero exit code is used by the test infrastructure to detect
21 // failure. 20 // failure.
22 exit(1); 21 exit(1);
23 } 22 }
24 } 23 }
25 } 24 }
26 25
27 void useVMConfiguration() { 26 void useVMConfiguration() {
28 if (config != null) return; 27 config = _singleton;
29 configure(new VMConfiguration());
30 } 28 }
31 29
32 @deprecated 30 final _singleton = new VMConfiguration();
33 void useVmConfiguration() => useVMConfiguration();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698