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

Unified Diff: test/runner/runner_test.dart

Issue 2099553002: Add an option to run skipped tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/runner/json_reporter_test.dart ('k') | test/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/runner_test.dart
diff --git a/test/runner/runner_test.dart b/test/runner/runner_test.dart
index 045ce76e256d8e9083213742dc007b5d9b9ffe65..d05c58c8861b9f33557f5e9e6d116b3157e08040 100644
--- a/test/runner/runner_test.dart
+++ b/test/runner/runner_test.dart
@@ -61,6 +61,8 @@ Usage: pub run test [files or directories...]
-x, --exclude-tags Don't run tests with any of the specified tags.
Supports boolean selector syntax.
+ --[no-]run-skipped Run skipped tests instead of skipping them.
+
======== Running Tests
-p, --platform The platform(s) on which to run the tests.
$_browsers
@@ -359,22 +361,32 @@ $_usage""");
test.shouldExit(1);
});
- test("respects top-level @Skip declarations", () {
- d.file("test.dart", '''
-@Skip()
+ group("with a top-level @Skip declaration", () {
+ setUp(() {
+ d.file("test.dart", '''
+ @Skip()
-import 'dart:async';
+ import 'dart:async';
-import 'package:test/test.dart';
+ import 'package:test/test.dart';
-void main() {
- test("fail", () => throw 'oh no');
-}
-''').create();
+ void main() {
+ test("success", () {});
+ }
+ ''').create();
+ });
- var test = runTest(["test.dart"]);
- test.stdout.expect(consumeThrough(contains("+0 ~1: All tests skipped.")));
- test.shouldExit(0);
+ test("skips all tests", () {
+ var test = runTest(["test.dart"]);
+ test.stdout.expect(consumeThrough(contains("+0 ~1: All tests skipped.")));
+ test.shouldExit(0);
+ });
+
+ test("runs all tests with --run-skipped", () {
+ var test = runTest(["--run-skipped", "test.dart"]);
+ test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
+ test.shouldExit(0);
+ });
});
group("with onPlatform", () {
« no previous file with comments | « test/runner/json_reporter_test.dart ('k') | test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698