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