| OLD | NEW |
| 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:scheduled_test/descriptor.dart' as d; | 10 import 'package:scheduled_test/descriptor.dart' as d; |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 }); | 337 }); |
| 338 | 338 |
| 339 test("runs tests even when a file fails to load", () { | 339 test("runs tests even when a file fails to load", () { |
| 340 d.file("test.dart", _success).create(); | 340 d.file("test.dart", _success).create(); |
| 341 | 341 |
| 342 var test = runTest(["test.dart", "nonexistent.dart"]); | 342 var test = runTest(["test.dart", "nonexistent.dart"]); |
| 343 test.stdout.expect(consumeThrough(contains("+1 -1: Some tests failed."))); | 343 test.stdout.expect(consumeThrough(contains("+1 -1: Some tests failed."))); |
| 344 test.shouldExit(1); | 344 test.shouldExit(1); |
| 345 }); | 345 }); |
| 346 | 346 |
| 347 test("respects top-level @Timeout declarations", () { | |
| 348 d.file("test.dart", ''' | |
| 349 @Timeout(const Duration(seconds: 0)) | |
| 350 | |
| 351 import 'dart:async'; | |
| 352 | |
| 353 import 'package:test/test.dart'; | |
| 354 | |
| 355 void main() { | |
| 356 test("timeout", () {}); | |
| 357 } | |
| 358 ''').create(); | |
| 359 | |
| 360 var test = runTest(["test.dart"]); | |
| 361 test.stdout.expect(containsInOrder([ | |
| 362 "Test timed out after 0 seconds.", | |
| 363 "-1: Some tests failed." | |
| 364 ])); | |
| 365 test.shouldExit(1); | |
| 366 }); | |
| 367 | |
| 368 test("respects top-level @Skip declarations", () { | 347 test("respects top-level @Skip declarations", () { |
| 369 d.file("test.dart", ''' | 348 d.file("test.dart", ''' |
| 370 @Skip() | 349 @Skip() |
| 371 | 350 |
| 372 import 'dart:async'; | 351 import 'dart:async'; |
| 373 | 352 |
| 374 import 'package:test/test.dart'; | 353 import 'package:test/test.dart'; |
| 375 | 354 |
| 376 void main() { | 355 void main() { |
| 377 test("fail", () => throw 'oh no'); | 356 test("fail", () => throw 'oh no'); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 d.file("test.dart", _success).create(); | 648 d.file("test.dart", _success).create(); |
| 670 | 649 |
| 671 var test = runTest(["--plain-name", "no match", "test.dart"]); | 650 var test = runTest(["--plain-name", "no match", "test.dart"]); |
| 672 test.stderr.expect( | 651 test.stderr.expect( |
| 673 consumeThrough(contains('No tests match "no match".'))); | 652 consumeThrough(contains('No tests match "no match".'))); |
| 674 test.shouldExit(exit_codes.data); | 653 test.shouldExit(exit_codes.data); |
| 675 }); | 654 }); |
| 676 }); | 655 }); |
| 677 }); | 656 }); |
| 678 } | 657 } |
| OLD | NEW |