Index: tests/compiler/dart2js/analyze_helper.dart |
diff --git a/tests/compiler/dart2js/analyze_helper.dart b/tests/compiler/dart2js/analyze_helper.dart |
index 217b6f5117fe2daee96903cede9f949b03cf1b9c..2461c984ac897314d62b9178427f154b75c16847 100644 |
--- a/tests/compiler/dart2js/analyze_helper.dart |
+++ b/tests/compiler/dart2js/analyze_helper.dart |
@@ -17,6 +17,9 @@ import 'package:compiler/src/filenames.dart'; |
import 'package:compiler/src/source_file_provider.dart'; |
import 'package:compiler/src/util/uri_extras.dart'; |
+/// Option for hiding whitelisted messages. |
+const String HIDE_WHITELISTED = '--hide-whitelisted'; |
+ |
/** |
* Map of whitelisted warnings and errors. |
* |
@@ -34,6 +37,7 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler { |
bool hasHint = false; |
bool hasErrors = false; |
bool lastWasWhitelisted = false; |
+ bool showWhitelisted = true; |
Map<String, Map<dynamic/*String|MessageKind*/, int>> whiteListMap |
= new Map<String, Map<dynamic/*String|MessageKind*/, int>>(); |
@@ -113,7 +117,7 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler { |
if (checkWhiteList(uri, message, text)) { |
// Suppress whitelisted warnings. |
lastWasWhitelisted = true; |
- if (verbose) { |
+ if (showWhitelisted || verbose) { |
super.report(message, uri, begin, end, text, kind); |
} |
return; |
@@ -124,7 +128,7 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler { |
if (checkWhiteList(uri, message, text)) { |
// Suppress whitelisted hints. |
lastWasWhitelisted = true; |
- if (verbose) { |
+ if (showWhitelisted || verbose) { |
super.report(message, uri, begin, end, text, kind); |
} |
return; |
@@ -135,7 +139,7 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler { |
if (checkWhiteList(uri, message, text)) { |
// Suppress whitelisted errors. |
lastWasWhitelisted = true; |
- if (verbose) { |
+ if (showWhitelisted || verbose) { |
super.report(message, uri, begin, end, text, kind); |
} |
return; |
@@ -204,6 +208,9 @@ Future analyze(List<Uri> uriList, |
if (options.contains(Flags.verbose)) { |
handler.verbose = true; |
} |
+ if (options.contains(HIDE_WHITELISTED)) { |
+ handler.showWhitelisted = false; |
+ } |
Bill Hesse
2016/03/29 11:56:26
Are verbose and showWhitelisted only used together
Johnni Winther
2016/03/30 07:02:30
Verbose include (some very noisy) info messages wh
|
var compiler = new CompilerImpl( |
provider, |
null, |
@@ -225,12 +232,15 @@ Future analyze(List<Uri> uriList, |
if (mode == AnalysisMode.URI) { |
for (Uri uri in uriList) { |
+ print('Analyzing uri: $uri'); |
await compiler.analyzeUri(uri); |
} |
} else if (mode != AnalysisMode.TREE_SHAKING) { |
+ print('Analyzing libraries: $uriList'); |
compiler.librariesToAnalyzeWhenRun = uriList; |
await compiler.run(null); |
} else { |
+ print('Analyzing entry point: ${uriList.single}'); |
await compiler.run(uriList.single); |
} |