Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.analyze_test.test; | 5 library dart2js.analyze_test.test; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
| 10 import 'package:compiler/src/apiimpl.dart' show | 10 import 'package:compiler/src/apiimpl.dart' show |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 main(List<String> arguments) { | 59 main(List<String> arguments) { |
| 60 List<String> options = <String>[]; | 60 List<String> options = <String>[]; |
| 61 for (String argument in arguments) { | 61 for (String argument in arguments) { |
| 62 if (argument == '-v') { | 62 if (argument == '-v') { |
| 63 options.add(Flags.verbose); | 63 options.add(Flags.verbose); |
| 64 } else if (argument.startsWith('-')) { | 64 } else if (argument.startsWith('-')) { |
| 65 options.add(argument); | 65 options.add(argument); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 List<Uri> uriList = <Uri>[]; | 68 List<Uri> uriList = <Uri>[]; |
| 69 String filter; | |
| 69 for (String arg in arguments) { | 70 for (String arg in arguments) { |
| 70 if (!arg.startsWith('-')) { | 71 if (!arg.startsWith('-')) { |
| 71 for (String line in new File(arg).readAsLinesSync()) { | 72 File file = new File(arg); |
| 72 line = line.trim(); | 73 if (file.existsSync()) { |
| 73 if (line.startsWith('Analyzing uri: ')) { | 74 for (String line in file.readAsLinesSync()) { |
| 74 int filenameOffset = line.indexOf('tests/compiler/dart2js/'); | 75 line = line.trim(); |
| 75 if (filenameOffset != -1) { | 76 if (line.startsWith('Analyzing uri: ')) { |
| 76 uriList.add(Uri.base.resolve( | 77 int filenameOffset = line.indexOf('tests/compiler/dart2js/'); |
| 77 nativeToUriPath(line.substring(filenameOffset)))); | 78 if (filenameOffset != -1) { |
| 79 uriList.add(Uri.base.resolve( | |
| 80 nativeToUriPath(line.substring(filenameOffset)))); | |
| 81 } | |
| 78 } | 82 } |
| 79 } | 83 } |
| 84 } else { | |
|
Siggi Cherem (dart-lang)
2016/05/14 00:21:35
does this relates to the other changes in this CL?
Johnni Winther
2016/05/17 10:22:39
Nah. It was used to help create the CL, though.
| |
| 85 filter = arg; | |
| 80 } | 86 } |
| 81 } | 87 } |
| 82 } | 88 } |
| 83 | 89 |
| 84 asyncTest(() async { | 90 asyncTest(() async { |
| 85 if (uriList.isEmpty) { | 91 if (uriList.isEmpty) { |
| 86 Directory dir = | 92 Directory dir = |
| 87 new Directory.fromUri(Uri.base.resolve('tests/compiler/dart2js/')); | 93 new Directory.fromUri(Uri.base.resolve('tests/compiler/dart2js/')); |
| 88 for (FileSystemEntity entity in dir.listSync(recursive: true)) { | 94 for (FileSystemEntity entity in dir.listSync(recursive: true)) { |
| 89 if (entity is File && entity.path.endsWith('.dart')) { | 95 if (entity is File && entity.path.endsWith('.dart')) { |
| 90 Uri file = Uri.base.resolve(nativeToUriPath(entity.path)); | 96 Uri file = Uri.base.resolve(nativeToUriPath(entity.path)); |
| 97 if (filter != null && !'$file'.contains(filter)) { | |
| 98 continue; | |
| 99 } | |
| 91 if (!SKIP_LIST.any((skip) => file.path.contains(skip))) { | 100 if (!SKIP_LIST.any((skip) => file.path.contains(skip))) { |
| 92 uriList.add(file); | 101 uriList.add(file); |
| 93 } | 102 } |
| 94 } | 103 } |
| 95 } | 104 } |
| 96 } | 105 } |
| 97 await analyze( | 106 await analyze( |
| 98 uriList, | 107 uriList, |
| 99 WHITE_LIST, | 108 WHITE_LIST, |
| 100 mode: AnalysisMode.URI, | 109 mode: AnalysisMode.URI, |
| 101 options: options, | 110 options: options, |
| 102 skipList: MESSAGE_SKIP_LIST); | 111 skipList: MESSAGE_SKIP_LIST); |
| 103 }); | 112 }); |
| 104 } | 113 } |
| OLD | NEW |