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) && | 240 if (!(analysisOptions?.path?.contains("/pkg/compiler/") ?? false) && |
241 diagnostic.code.startsWith("STRONG_MODE") && | 241 diagnostic.code.startsWith("STRONG_MODE") && |
242 (path.startsWith("pkg/compiler/") || | 242 (path.startsWith("pkg/compiler/") || |
243 path.startsWith("tests/compiler/dart2js/"))) { | 243 path.startsWith("tests/compiler/dart2js/"))) { |
244 // TODO(ahe): Remove this hack to work around dart2js not being | 244 // TODO(ahe): Remove this hack to work around dart2js not being |
245 // strong-mode clean. | 245 // strong-mode clean. |
246 continue; | 246 continue; |
247 } | 247 } |
248 if (!filesToAnalyze.contains(path)) continue; | 248 if (!filesToAnalyze.contains(path)) continue; |
249 } | 249 } |
250 String message = "$diagnostic"; | 250 String message = "$diagnostic"; |
(...skipping 23 matching lines...) Expand all Loading... |
274 ProcessResult result = await Process.run( | 274 ProcessResult result = await Process.run( |
275 Platform.isWindows ? "git.bat" : "git", | 275 Platform.isWindows ? "git.bat" : "git", |
276 <String>[command]..addAll(arguments), | 276 <String>[command]..addAll(arguments), |
277 workingDirectory: workingDirectory); | 277 workingDirectory: workingDirectory); |
278 if (result.exitCode != 0) { | 278 if (result.exitCode != 0) { |
279 throw "Non-zero exit code from git $command (${result.exitCode})\n" | 279 throw "Non-zero exit code from git $command (${result.exitCode})\n" |
280 "${result.stdout}\n${result.stderr}"; | 280 "${result.stdout}\n${result.stderr}"; |
281 } | 281 } |
282 return result.stdout; | 282 return result.stdout; |
283 } | 283 } |
OLD | NEW |