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

Unified Diff: test/runner/configuration/top_level_test.dart

Issue 1717533002: Add new test configuration fields. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 10 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/configuration/configuration_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/configuration/top_level_test.dart
diff --git a/test/runner/configuration/top_level_test.dart b/test/runner/configuration/top_level_test.dart
index af38e0e843f8240bda26d81eeb4d633a5be4c456..62103dbd5d986fbb48bda40ad4eec07d4d9eb6ec 100644
--- a/test/runner/configuration/top_level_test.dart
+++ b/test/runner/configuration/top_level_test.dart
@@ -72,6 +72,79 @@ void main() {
test.shouldExit(1);
}, tags: 'chrome');
+ test("skips tests with skip: true", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "skip": true
+ })).create();
+
+ d.file("test.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("test", () {});
+ }
+ """).create();
+
+ var test = runTest(["test.dart"]);
+ test.stdout.expect(consumeThrough(contains('All tests skipped.')));
+ test.shouldExit(0);
+ });
+
+ test("skips tests with skip: reason", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "skip": "Tests are boring."
+ })).create();
+
+ d.file("test.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("test", () {});
+ }
+ """).create();
+
+ var test = runTest(["test.dart"]);
+ test.stdout.expect(consumeThrough(contains('Tests are boring.')));
+ test.stdout.expect(consumeThrough(contains('All tests skipped.')));
+ test.shouldExit(0);
+ });
+
+ test("runs tests on a platform that matches test_on", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "test_on": "vm"
+ })).create();
+
+ d.file("test.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("test", () {});
+ }
+ """).create();
+
+ var test = runTest(["test.dart"]);
+ test.stdout.expect(consumeThrough(contains('All tests passed!')));
+ test.shouldExit(0);
+ });
+
+ test("doesn't run tests on a platform that doesn't match test_on", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "test_on": "chrome"
+ })).create();
+
+ d.file("test.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("test", () {});
+ }
+ """).create();
+
+ var test = runTest(["test.dart"]);
+ test.stdout.expect(consumeThrough(contains('No tests ran.')));
+ test.shouldExit(0);
+ });
+
test("uses the specified reporter", () {
d.file("dart_test.yaml", JSON.encode({
"reporter": "json"
« no previous file with comments | « test/runner/configuration/configuration_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698