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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library testing.analyze; | 5 library testing.analyze; |
6 | 6 |
7 import 'dart:async' show Stream, Future; | 7 import 'dart:async' show Stream, Future; |
8 | 8 |
9 import 'dart:convert' show LineSplitter, UTF8; | 9 import 'dart:convert' show LineSplitter, UTF8; |
10 | 10 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 process.stdin.writeln(arguments.join(" ")); | 230 process.stdin.writeln(arguments.join(" ")); |
231 process.stdin.close(); | 231 process.stdin.close(); |
232 | 232 |
233 bool hasOutput = false; | 233 bool hasOutput = false; |
234 Set<String> seen = new Set<String>(); | 234 Set<String> seen = new Set<String>(); |
235 | 235 |
236 processAnalyzerOutput(Stream<AnalyzerDiagnostic> diagnostics) async { | 236 processAnalyzerOutput(Stream<AnalyzerDiagnostic> diagnostics) async { |
237 await for (AnalyzerDiagnostic diagnostic in diagnostics) { | 237 await for (AnalyzerDiagnostic diagnostic in diagnostics) { |
238 if (diagnostic.uri != null) { | 238 if (diagnostic.uri != null) { |
239 String path = toFilePath(diagnostic.uri); | 239 String path = toFilePath(diagnostic.uri); |
240 if (!(analysisOptions?.path?.contains("/pkg/compiler/") ?? false) && | |
241 diagnostic.code.startsWith("STRONG_MODE") && | |
242 (path.startsWith("pkg/compiler/") || | |
243 path.startsWith("tests/compiler/dart2js/"))) { | |
244 // TODO(ahe): Remove this hack to work around dart2js not being | |
245 // strong-mode clean. | |
246 continue; | |
247 } | |
248 if (!filesToAnalyze.contains(path)) continue; | 240 if (!filesToAnalyze.contains(path)) continue; |
249 } | 241 } |
250 String message = "$diagnostic"; | 242 String message = "$diagnostic"; |
251 if (seen.add(message)) { | 243 if (seen.add(message)) { |
252 hasOutput = true; | 244 hasOutput = true; |
253 print(message); | 245 print(message); |
254 } | 246 } |
255 } | 247 } |
256 } | 248 } |
257 | 249 |
(...skipping 16 matching lines...) Expand all Loading... |
274 ProcessResult result = await Process.run( | 266 ProcessResult result = await Process.run( |
275 Platform.isWindows ? "git.bat" : "git", | 267 Platform.isWindows ? "git.bat" : "git", |
276 <String>[command]..addAll(arguments), | 268 <String>[command]..addAll(arguments), |
277 workingDirectory: workingDirectory); | 269 workingDirectory: workingDirectory); |
278 if (result.exitCode != 0) { | 270 if (result.exitCode != 0) { |
279 throw "Non-zero exit code from git $command (${result.exitCode})\n" | 271 throw "Non-zero exit code from git $command (${result.exitCode})\n" |
280 "${result.stdout}\n${result.stderr}"; | 272 "${result.stdout}\n${result.stderr}"; |
281 } | 273 } |
282 return result.stdout; | 274 return result.stdout; |
283 } | 275 } |
OLD | NEW |