Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: tests/compiler/dart2js/analyze_helper.dart

Issue 1885523002: Add summary to analyze_* tests. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update cf. comments. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/compiler/dart2js/analyze_test_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/analyze_test_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698