Index: tests/compiler/dart2js/analyze_helper.dart |
diff --git a/tests/compiler/dart2js/analyze_helper.dart b/tests/compiler/dart2js/analyze_helper.dart |
index 61b52be8de1ce672182b6eb86391b04150521fd8..fb06d78cf187bb8408bbcc7617c036a53a8849d5 100644 |
--- a/tests/compiler/dart2js/analyze_helper.dart |
+++ b/tests/compiler/dart2js/analyze_helper.dart |
@@ -17,6 +17,7 @@ import 'package:compiler/src/options.dart' show |
CompilerOptions; |
import 'package:compiler/src/source_file_provider.dart'; |
import 'package:compiler/src/util/uri_extras.dart'; |
+import 'diagnostic_helper.dart'; |
/// Option for hiding whitelisted messages. |
const String HIDE_WHITELISTED = '--hide-whitelisted'; |
@@ -43,6 +44,7 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler { |
Map<String, Map<dynamic/*String|MessageKind*/, int>> whiteListMap |
= new Map<String, Map<dynamic/*String|MessageKind*/, int>>(); |
List<MessageKind> skipList; |
+ List<CollectedMessage> collectedMessages = <CollectedMessage>[]; |
CollectingDiagnosticHandler( |
Map<String, List/*<String|MessageKind>*/> whiteList, |
@@ -61,6 +63,7 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler { |
bool checkResults() { |
bool validWhiteListUse = checkWhiteListUse(); |
reportWhiteListUse(); |
+ reportCollectedMessages(); |
return !hasWarnings && !hasHint && !hasErrors && validWhiteListUse; |
} |
@@ -78,6 +81,19 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler { |
return allUsed; |
} |
+ void reportCollectedMessages() { |
+ if (collectedMessages.isNotEmpty) { |
+ print('----------------------------------------------------------------'); |
+ print('Unexpected messages:'); |
+ print('----------------------------------------------------------------'); |
+ for (CollectedMessage message in collectedMessages) { |
+ super.report(message.message, message.uri, message.begin, |
+ message.end, message.text, message.kind); |
+ } |
+ print('----------------------------------------------------------------'); |
+ } |
+ } |
+ |
void reportWhiteListUse() { |
for (String file in whiteListMap.keys) { |
for (var messagePart in whiteListMap[file].keys) { |
@@ -156,6 +172,10 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler { |
return; |
} |
lastWasWhitelisted = false; |
+ if (kind != api.Diagnostic.VERBOSE_INFO) { |
+ collectedMessages.add(new CollectedMessage( |
+ message, uri, begin, end, text, kind)); |
+ } |
super.report(message, uri, begin, end, text, kind); |
} |
} |