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

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

Issue 2009163003: Add support for --dart2js-path and --dart2js-args. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 7 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 | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/configuration/configuration_test.dart
diff --git a/test/runner/configuration/configuration_test.dart b/test/runner/configuration/configuration_test.dart
index cb0e0e0cfc7b635cd7ddb9a3e820ef317290978a..a0b340de2e7a9dfa15c195fb9dbd689520ab8654 100644
--- a/test/runner/configuration/configuration_test.dart
+++ b/test/runner/configuration/configuration_test.dart
@@ -30,6 +30,7 @@ void main() {
expect(merged.shardIndex, isNull);
expect(merged.totalShards, isNull);
expect(merged.packageRoot, equals(p.join(p.current, 'packages')));
+ expect(merged.dart2jsPath, equals(p.join(sdkDir, 'bin', 'dart2js')));
expect(merged.reporter, equals(defaultReporter));
expect(merged.pubServeUrl, isNull);
expect(merged.platforms, equals([TestPlatform.vm]));
@@ -49,6 +50,7 @@ void main() {
shardIndex: 3,
totalShards: 10,
packageRoot: "root",
+ dart2jsPath: "/tmp/dart2js",
reporter: "json",
pubServePort: 1234,
platforms: [TestPlatform.chrome],
@@ -66,6 +68,7 @@ void main() {
expect(merged.shardIndex, equals(3));
expect(merged.totalShards, equals(10));
expect(merged.packageRoot, equals("root"));
+ expect(merged.dart2jsPath, equals("/tmp/dart2js"));
expect(merged.reporter, equals("json"));
expect(merged.pubServeUrl.port, equals(1234));
expect(merged.platforms, equals([TestPlatform.chrome]));
@@ -85,6 +88,7 @@ void main() {
shardIndex: 3,
totalShards: 10,
packageRoot: "root",
+ dart2jsPath: "/tmp/dart2js",
reporter: "json",
pubServePort: 1234,
platforms: [TestPlatform.chrome],
@@ -101,6 +105,7 @@ void main() {
expect(merged.shardIndex, equals(3));
expect(merged.totalShards, equals(10));
expect(merged.packageRoot, equals("root"));
+ expect(merged.dart2jsPath, equals("/tmp/dart2js"));
expect(merged.reporter, equals("json"));
expect(merged.pubServeUrl.port, equals(1234));
expect(merged.platforms, equals([TestPlatform.chrome]));
@@ -121,6 +126,7 @@ void main() {
shardIndex: 2,
totalShards: 4,
packageRoot: "root",
+ dart2jsPath: "/tmp/dart2js",
reporter: "json",
pubServePort: 1234,
platforms: [TestPlatform.chrome],
@@ -137,6 +143,7 @@ void main() {
shardIndex: 3,
totalShards: 10,
packageRoot: "boot",
+ dart2jsPath: "../dart2js",
reporter: "compact",
pubServePort: 5678,
platforms: [TestPlatform.dartium],
@@ -153,6 +160,7 @@ void main() {
expect(merged.shardIndex, equals(3));
expect(merged.totalShards, equals(10));
expect(merged.packageRoot, equals("boot"));
+ expect(merged.dart2jsPath, equals("../dart2js"));
expect(merged.reporter, equals("compact"));
expect(merged.pubServeUrl.port, equals(5678));
expect(merged.platforms, equals([TestPlatform.dartium]));
@@ -320,6 +328,32 @@ void main() {
});
});
+ group("for dart2jsArgs", () {
+ test("if neither is defined, preserves the default", () {
+ var merged = new Configuration().merge(new Configuration());
+ expect(merged.dart2jsArgs, isEmpty);
+ });
+
+ test("if only the old configuration's is defined, uses it", () {
+ var merged = new Configuration(dart2jsArgs: ["--foo", "--bar"])
+ .merge(new Configuration());
+ expect(merged.dart2jsArgs, equals(["--foo", "--bar"]));
+ });
+
+ test("if only the new configuration's is defined, uses it", () {
+ var merged = new Configuration()
+ .merge(new Configuration(dart2jsArgs: ["--foo", "--bar"]));
+ expect(merged.dart2jsArgs, equals(["--foo", "--bar"]));
+ });
+
+ test("if both are defined, concatenates them", () {
+ var older = new Configuration(dart2jsArgs: ["--foo", "--bar"]);
+ var newer = new Configuration(dart2jsArgs: ["--baz"]);
+ var merged = older.merge(newer);
+ expect(merged.dart2jsArgs, equals(["--foo", "--bar", "--baz"]));
+ });
+ });
+
group("for config maps", () {
test("merges each nested configuration", () {
var merged = new Configuration(
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698