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

Side by Side Diff: test/runner/runner_test.dart

Issue 1316213003: Fix tests that invoke Dart explicitly. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 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
« no previous file with comments | « no previous file | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:path/path.dart' as p;
11 import 'package:scheduled_test/descriptor.dart' as d; 10 import 'package:scheduled_test/descriptor.dart' as d;
12 import 'package:scheduled_test/scheduled_stream.dart'; 11 import 'package:scheduled_test/scheduled_stream.dart';
13 import 'package:scheduled_test/scheduled_test.dart'; 12 import 'package:scheduled_test/scheduled_test.dart';
14 import 'package:test/src/util/exit_codes.dart' as exit_codes; 13 import 'package:test/src/util/exit_codes.dart' as exit_codes;
15 14
16 import '../io.dart'; 15 import '../io.dart';
17 16
18 final _success = """ 17 final _success = """
19 import 'dart:async'; 18 import 'dart:async';
20 19
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 return d.file("${i}_test.dart", _success); 273 return d.file("${i}_test.dart", _success);
275 })).create(); 274 })).create();
276 275
277 var test = runTest([]); 276 var test = runTest([]);
278 test.stdout.expect(consumeThrough(contains("+3: All tests passed!"))); 277 test.stdout.expect(consumeThrough(contains("+3: All tests passed!")));
279 test.shouldExit(0); 278 test.shouldExit(0);
280 }); 279 });
281 280
282 test("directly", () { 281 test("directly", () {
283 d.file("test.dart", _success).create(); 282 d.file("test.dart", _success).create();
284 var test = runDart([ 283 var test = runDart(["test.dart"]);
285 "--package-root=${p.join(packageDir, 'packages')}",
286 "test.dart"
287 ]);
288 284
289 test.stdout.expect(consumeThrough(contains("All tests passed!"))); 285 test.stdout.expect(consumeThrough(contains("All tests passed!")));
290 test.shouldExit(0); 286 test.shouldExit(0);
291 }); 287 });
292 288
293 // Regression test; this broke in 0.12.0-beta.9. 289 // Regression test; this broke in 0.12.0-beta.9.
294 test("on a file in a subdirectory", () { 290 test("on a file in a subdirectory", () {
295 d.dir("dir", [d.file("test.dart", _success)]).create(); 291 d.dir("dir", [d.file("test.dart", _success)]).create();
296 292
297 var test = runTest(["dir/test.dart"]); 293 var test = runTest(["dir/test.dart"]);
(...skipping 26 matching lines...) Expand all
324 return d.file("${i}_test.dart", _failure); 320 return d.file("${i}_test.dart", _failure);
325 })).create(); 321 })).create();
326 322
327 var test = runTest([]); 323 var test = runTest([]);
328 test.stdout.expect(consumeThrough(contains("-3: Some tests failed."))); 324 test.stdout.expect(consumeThrough(contains("-3: Some tests failed.")));
329 test.shouldExit(1); 325 test.shouldExit(1);
330 }); 326 });
331 327
332 test("directly", () { 328 test("directly", () {
333 d.file("test.dart", _failure).create(); 329 d.file("test.dart", _failure).create();
334 var test = runDart([ 330 var test = runDart(["test.dart"]);
335 "--package-root=${p.join(packageDir, 'packages')}",
336 "test.dart"
337 ]);
338 test.stdout.expect(consumeThrough(contains("Some tests failed."))); 331 test.stdout.expect(consumeThrough(contains("Some tests failed.")));
339 test.shouldExit(255); 332 test.shouldExit(255);
340 }); 333 });
341 }); 334 });
342 335
343 test("runs tests even when a file fails to load", () { 336 test("runs tests even when a file fails to load", () {
344 d.file("test.dart", _success).create(); 337 d.file("test.dart", _success).create();
345 338
346 var test = runTest(["test.dart", "nonexistent.dart"]); 339 var test = runTest(["test.dart", "nonexistent.dart"]);
347 test.stdout.expect(consumeThrough(contains("+1 -1: Some tests failed."))); 340 test.stdout.expect(consumeThrough(contains("+1 -1: Some tests failed.")));
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 d.file("test.dart", _success).create(); 666 d.file("test.dart", _success).create();
674 667
675 var test = runTest(["--plain-name", "no match", "test.dart"]); 668 var test = runTest(["--plain-name", "no match", "test.dart"]);
676 test.stderr.expect( 669 test.stderr.expect(
677 consumeThrough(contains('No tests match "no match".'))); 670 consumeThrough(contains('No tests match "no match".')));
678 test.shouldExit(exit_codes.data); 671 test.shouldExit(exit_codes.data);
679 }); 672 });
680 }); 673 });
681 }); 674 });
682 } 675 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698