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

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

Issue 10917006: More uses of the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
« no previous file with comments | « pkg/unittest/core_matchers.dart ('k') | runtime/vm/exceptions_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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'); 8 #library('unittest');
9 9
10 #import('dart:io'); 10 #import('dart:io');
11 #import('unittest.dart'); 11 #import('unittest.dart');
12 12
13 class VmConfiguration extends Configuration { 13 class VmConfiguration extends Configuration {
14 void onDone(int passed, int failed, int errors, List<TestCase> results, 14 void onDone(int passed, int failed, int errors, List<TestCase> results,
15 String uncaughtError) { 15 String uncaughtError) {
16 try { 16 try {
17 super.onDone(passed, failed, errors, results, uncaughtError); 17 super.onDone(passed, failed, errors, results, uncaughtError);
18 } catch (Exception ex) { 18 } on Exception catch (ex) {
19 // 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
20 // failure. 20 // failure.
21 exit(1); 21 exit(1);
22 } 22 }
23 } 23 }
24 } 24 }
25 25
26 void useVmConfiguration() { 26 void useVmConfiguration() {
27 configure(new VmConfiguration()); 27 configure(new VmConfiguration());
28 } 28 }
OLDNEW
« no previous file with comments | « pkg/unittest/core_matchers.dart ('k') | runtime/vm/exceptions_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698