| Index: sdk/lib/_internal/pub/test/build/reports_dart_parse_errors_test.dart
|
| diff --git a/sdk/lib/_internal/pub/test/build/reports_dart_parse_errors_test.dart b/sdk/lib/_internal/pub/test/build/reports_dart_parse_errors_test.dart
|
| index 1e5e1441f1e9a257005079b27348038637d4bdc0..bd0db6891fb0c043a1f5bcb8a8a5345f7abbac9a 100644
|
| --- a/sdk/lib/_internal/pub/test/build/reports_dart_parse_errors_test.dart
|
| +++ b/sdk/lib/_internal/pub/test/build/reports_dart_parse_errors_test.dart
|
| @@ -2,7 +2,9 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| +import 'package:path/path.dart' as p;
|
| import 'package:scheduled_test/scheduled_test.dart';
|
| +import 'package:scheduled_test/scheduled_stream.dart';
|
|
|
| import '../../lib/src/exit_codes.dart' as exit_codes;
|
| import '../descriptor.dart' as d;
|
| @@ -27,16 +29,25 @@ main() {
|
| ])
|
| ]).create();
|
|
|
| - schedulePub(args: ["build"],
|
| - // TODO(rnystrom): Figure out why dart2js errors aren't deterministic.
|
| - // Use a lookahead regexp to do two searches in one regexp.
|
| - // Checked all non-matching cases for bad performance.
|
| - error: new RegExp(
|
| - r"(?=(.|\n)*^Error in .*[/\\]file\.dart:)"
|
| - r"(.|\n)*^Error in .*[/\\]subfile\.dart:",
|
| - multiLine: true),
|
| - output: new RegExp(r"Building myapp\.\.\.*"),
|
| - exitCode: exit_codes.DATA);
|
| + var pub = startPub(args: ["build"]);
|
| + pub.stdout.expect(startsWith("Building myapp..."));
|
| +
|
| + var consumeFile = consumeThrough(inOrder([
|
| + "[Error from Dart2JS]:",
|
| + startsWith(p.join("web", "file.dart") + ":")
|
| + ]));
|
| + var consumeSubfile = consumeThrough(inOrder([
|
| + "[Error from Dart2JS]:",
|
| + startsWith(p.join("web", "subdir", "subfile.dart") + ":")
|
| + ]));
|
| +
|
| + // It's nondeterministic what order the dart2js transformers start running,
|
| + // so we allow the error messages to be emitted in either order.
|
| + pub.stderr.expect(either(
|
| + inOrder([consumeFile, consumeSubfile]),
|
| + inOrder([consumeSubfile, consumeFile])));
|
| +
|
| + pub.shouldExit(exit_codes.DATA);
|
|
|
| // Doesn't output anything if an error occurred.
|
| d.dir(appPath, [
|
|
|