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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 "http_test.dart", | 51 "http_test.dart", |
52 ]; | 52 ]; |
53 | 53 |
54 const List<MessageKind> MESSAGE_SKIP_LIST = const <MessageKind>[ | 54 const List<MessageKind> MESSAGE_SKIP_LIST = const <MessageKind>[ |
55 // TODO(johnniwinther): Support checking of this warning. (Issue 26132) | 55 // TODO(johnniwinther): Support checking of this warning. (Issue 26132) |
56 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, | 56 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, |
57 ]; | 57 ]; |
58 | 58 |
59 main(List<String> arguments) { | 59 main(List<String> arguments) { |
60 List<String> options = <String>[]; | 60 List<String> options = <String>[]; |
61 if (arguments.contains('-v') || arguments.contains(Flags.verbose)) { | 61 for (String argument in arguments) { |
62 options.add(Flags.verbose); | 62 if (argument == '-v') { |
| 63 options.add(Flags.verbose); |
| 64 } else if (argument.startsWith('-')) { |
| 65 options.add(argument); |
| 66 } |
63 } | 67 } |
64 List<Uri> uriList = <Uri>[]; | 68 List<Uri> uriList = <Uri>[]; |
65 for (String arg in arguments) { | 69 for (String arg in arguments) { |
66 if (!arg.startsWith('-')) { | 70 if (!arg.startsWith('-')) { |
67 for (String line in new File(arg).readAsLinesSync()) { | 71 for (String line in new File(arg).readAsLinesSync()) { |
68 line = line.trim(); | 72 line = line.trim(); |
69 if (line.startsWith('Analyzing uri: ')) { | 73 if (line.startsWith('Analyzing uri: ')) { |
70 int filenameOffset = line.indexOf('tests/compiler/dart2js/'); | 74 int filenameOffset = line.indexOf('tests/compiler/dart2js/'); |
71 if (filenameOffset != -1) { | 75 if (filenameOffset != -1) { |
72 uriList.add(Uri.base.resolve( | 76 uriList.add(Uri.base.resolve( |
(...skipping 18 matching lines...) Expand all Loading... |
91 } | 95 } |
92 } | 96 } |
93 await analyze( | 97 await analyze( |
94 uriList, | 98 uriList, |
95 WHITE_LIST, | 99 WHITE_LIST, |
96 mode: AnalysisMode.URI, | 100 mode: AnalysisMode.URI, |
97 options: options, | 101 options: options, |
98 skipList: MESSAGE_SKIP_LIST); | 102 skipList: MESSAGE_SKIP_LIST); |
99 }); | 103 }); |
100 } | 104 } |
OLD | NEW |