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

Side by Side Diff: tests/compiler/dart2js/exit_code_test.dart

Issue 1934883002: Refactor unittests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « tests/compiler/dart2js/exit_code_helper.dart ('k') | tests/compiler/dart2js/http_test.dart » ('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) 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 // Test the exit code of dart2js in case of exceptions, errors, warnings, etc. 5 // Test the exit code of dart2js in case of exceptions, errors, warnings, etc.
6 6
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io' show Platform; 9 import 'dart:io' show Platform;
10 10
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 void exit(exitCode) { 235 void exit(exitCode) {
236 if (foundExitCode == null) { 236 if (foundExitCode == null) {
237 foundExitCode = exitCode; 237 foundExitCode = exitCode;
238 } 238 }
239 }; 239 };
240 240
241 entry.exitFunc = exit; 241 entry.exitFunc = exit;
242 entry.compileFunc = compile; 242 entry.compileFunc = compile;
243 243
244 List<String> args = new List<String>.from(options) 244 List<String> args = new List<String>.from(options)
245 ..add("tests/compiler/dart2js/exit_code_helper.dart"); 245 ..add("tests/compiler/dart2js/data/exit_code_helper.dart");
246 Future result = entry.internalMain(args); 246 Future result = entry.internalMain(args);
247 return result.catchError((e, s) { 247 return result.catchError((e, s) {
248 // Capture crashes. 248 // Capture crashes.
249 }).whenComplete(checkResult); 249 }).whenComplete(checkResult);
250 }); 250 });
251 } 251 }
252 252
253 Future testExitCodes( 253 Future testExitCodes(
254 String marker, Map<String,int> expectedExitCodes, List<String> options) { 254 String marker, Map<String,int> expectedExitCodes, List<String> options) {
255 return Future.forEach(expectedExitCodes.keys, (String type) { 255 return Future.forEach(expectedExitCodes.keys, (String type) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 expected = _expectedExitCode( 307 expected = _expectedExitCode(
308 beforeRun: tests[marker], fatalWarnings: true); 308 beforeRun: tests[marker], fatalWarnings: true);
309 totalExpectedErrors += expected.length; 309 totalExpectedErrors += expected.length;
310 await testExitCodes(marker, expected, ['--fatal-warnings']); 310 await testExitCodes(marker, expected, ['--fatal-warnings']);
311 } 311 }
312 312
313 Expect.equals(totalExpectedErrors, checkedResults); 313 Expect.equals(totalExpectedErrors, checkedResults);
314 }); 314 });
315 } 315 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/exit_code_helper.dart ('k') | tests/compiler/dart2js/http_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698