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

Unified Diff: tests/compiler/dart2js/analyze_test_test.dart

Issue 1973753004: Change dart2js.dart to use compiler_new.dart (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. 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 | « pkg/compiler/lib/src/source_file_provider.dart ('k') | tests/compiler/dart2js/bad_output_io_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/analyze_test_test.dart
diff --git a/tests/compiler/dart2js/analyze_test_test.dart b/tests/compiler/dart2js/analyze_test_test.dart
index a38c814c37d47ba5a7bc9c3d1eb77443ddae13fd..af3eb252107658d8ee63acd1ddb61e0390345922 100644
--- a/tests/compiler/dart2js/analyze_test_test.dart
+++ b/tests/compiler/dart2js/analyze_test_test.dart
@@ -58,27 +58,34 @@ const List<MessageKind> MESSAGE_SKIP_LIST = const <MessageKind>[
main(List<String> arguments) {
List<String> options = <String>[];
- for (String argument in arguments) {
- if (argument == '-v') {
- options.add(Flags.verbose);
- } else if (argument.startsWith('-')) {
- options.add(argument);
- }
- }
List<Uri> uriList = <Uri>[];
- for (String arg in arguments) {
- if (!arg.startsWith('-')) {
- for (String line in new File(arg).readAsLinesSync()) {
- line = line.trim();
- if (line.startsWith('Analyzing uri: ')) {
- int filenameOffset = line.indexOf('tests/compiler/dart2js/');
- if (filenameOffset != -1) {
- uriList.add(Uri.base.resolve(
- nativeToUriPath(line.substring(filenameOffset))));
+ String filter;
+ bool first = true;
+ for (String argument in arguments) {
+ if (argument.startsWith('-')) {
+ options.add(argument == '-v' ? Flags.verbose : argument);
+ } else if (first) {
+ File file = new File(argument);
+ if (file.existsSync()) {
+ // Read test files from [file].
+ for (String line in file.readAsLinesSync()) {
+ line = line.trim();
+ if (line.startsWith('Analyzing uri: ')) {
+ int filenameOffset = line.indexOf('tests/compiler/dart2js/');
+ if (filenameOffset != -1) {
+ uriList.add(Uri.base.resolve(
+ nativeToUriPath(line.substring(filenameOffset))));
+ }
}
}
+ } else {
+ // Use argument as filter on test files.
+ filter = argument;
}
+ } else {
+ throw new ArgumentError("Extra argument $argument in $arguments.");
}
+ first = false;
}
asyncTest(() async {
@@ -88,6 +95,9 @@ main(List<String> arguments) {
for (FileSystemEntity entity in dir.listSync(recursive: true)) {
if (entity is File && entity.path.endsWith('.dart')) {
Uri file = Uri.base.resolve(nativeToUriPath(entity.path));
+ if (filter != null && !'$file'.contains(filter)) {
+ continue;
+ }
if (!SKIP_LIST.any((skip) => file.path.contains(skip))) {
uriList.add(file);
}
« no previous file with comments | « pkg/compiler/lib/src/source_file_provider.dart ('k') | tests/compiler/dart2js/bad_output_io_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698