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

Side by Side Diff: pkg/testing/lib/src/suite.dart

Issue 2693893002: Add a new kind of suite to ease test.dart integration. (Closed)
Patch Set: Fix Linux and Windows paths. Created 3 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 unified diff | Download patch
« no previous file with comments | « pkg/testing/lib/src/stdio_process.dart ('k') | pkg/testing/lib/src/test_dart.dart » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library testing.suite; 5 library testing.suite;
6 6
7 import 'chain.dart' show 7 import 'chain.dart' show
8 Chain; 8 Chain;
9 9
10 import 'test_dart.dart' show
11 TestDart;
12
10 /// Records the properties of a test suite. 13 /// Records the properties of a test suite.
11 abstract class Suite { 14 abstract class Suite {
12 final String name; 15 final String name;
13 16
14 final String kind; 17 final String kind;
15 18
16 final Uri statusFile; 19 final Uri statusFile;
17 20
18 Suite(this.name, this.kind, this.statusFile); 21 Suite(this.name, this.kind, this.statusFile);
19 22
20 factory Suite.fromJsonMap(Uri base, Map json) { 23 factory Suite.fromJsonMap(Uri base, Map json) {
21 String kind = json["kind"].toLowerCase(); 24 String kind = json["kind"].toLowerCase();
22 String name = json["name"]; 25 String name = json["name"];
23 switch (kind) { 26 switch (kind) {
24 case "dart": 27 case "dart":
25 return new Dart.fromJsonMap(base, json, name); 28 return new Dart.fromJsonMap(base, json, name);
26 29
27 case "chain": 30 case "chain":
28 return new Chain.fromJsonMap(base, json, name, kind); 31 return new Chain.fromJsonMap(base, json, name, kind);
29 32
33 case "test_dart":
34 return new TestDart.fromJsonMap(base, json, name, kind);
35
30 default: 36 default:
31 throw "Suite '$name' has unknown kind '$kind'."; 37 throw "Suite '$name' has unknown kind '$kind'.";
32 } 38 }
33 } 39 }
34 40
35 String toString() => "Suite($name, $kind)"; 41 String toString() => "Suite($name, $kind)";
36 } 42 }
37 43
38 /// A suite of standalone tests. The tests are combined and run as one program. 44 /// A suite of standalone tests. The tests are combined and run as one program.
39 /// 45 ///
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 Uri uri = base.resolve(json["path"]); 81 Uri uri = base.resolve(json["path"]);
76 List<RegExp> pattern = new List<RegExp>.from( 82 List<RegExp> pattern = new List<RegExp>.from(
77 json["pattern"].map((String p) => new RegExp(p))); 83 json["pattern"].map((String p) => new RegExp(p)));
78 List<RegExp> exclude = new List<RegExp>.from( 84 List<RegExp> exclude = new List<RegExp>.from(
79 json["exclude"].map((String p) => new RegExp(p))); 85 json["exclude"].map((String p) => new RegExp(p)));
80 return new Dart(name, uri, pattern, exclude); 86 return new Dart(name, uri, pattern, exclude);
81 } 87 }
82 88
83 String toString() => "Dart($name, $uri, $pattern, $exclude)"; 89 String toString() => "Dart($name, $uri, $pattern, $exclude)";
84 } 90 }
OLDNEW
« no previous file with comments | « pkg/testing/lib/src/stdio_process.dart ('k') | pkg/testing/lib/src/test_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698