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

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

Issue 1668573003: Add configuration support for choosing test paths. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: cr 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/top_level_error_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 25104452631dfa0f8bfd31881b998a7be43cb2d2..cde3ebc4627ffd92fc8b25fd81b3ba173f08a0ef 100644
--- a/test/runner/configuration/top_level_test.dart
+++ b/test/runner/configuration/top_level_test.dart
@@ -231,4 +231,80 @@ transformers:
test.stdout.expect(consumeThrough(contains("All tests passed!")));
test.shouldExit(0);
});
+
+ test("uses the specified paths", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "paths": ["zip", "zap"]
+ })).create();
+
+ d.dir("zip", [
+ d.file("zip_test.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("success", () {});
+ }
+ """)
+ ]).create();
+
+ d.dir("zap", [
+ d.file("zip_test.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("success", () {});
+ }
+ """)
+ ]).create();
+
+ d.dir("zop", [
+ d.file("zip_test.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("failure", () => throw "oh no");
+ }
+ """)
+ ]).create();
+
+ var test = runTest([]);
+ test.stdout.expect(consumeThrough(contains('All tests passed!')));
+ test.shouldExit(0);
+ });
+
+ test("uses the specified filename", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "filename": "test_*.dart"
+ })).create();
+
+ d.dir("test", [
+ d.file("test_foo.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("success", () {});
+ }
+ """),
+
+ d.file("foo_test.dart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("failure", () => throw "oh no");
+ }
+ """),
+
+ d.file("test_foo.bart", """
+ import 'package:test/test.dart';
+
+ void main() {
+ test("failure", () => throw "oh no");
+ }
+ """)
+ ]).create();
+
+ var test = runTest([]);
+ test.stdout.expect(consumeThrough(contains('All tests passed!')));
+ test.shouldExit(0);
+ });
}
« no previous file with comments | « test/runner/configuration/top_level_error_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698