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

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

Issue 1845563003: Skip checking of IMPORT_EXPERIMENTAL_MIRRORS warning in analyze_test_test. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 9 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 2461c984ac897314d62b9178427f154b75c16847..70a1f225680a0cd6d4fc0d449ba77f95f94a09c6 100644
--- a/tests/compiler/dart2js/analyze_helper.dart
+++ b/tests/compiler/dart2js/analyze_helper.dart
@@ -41,9 +41,11 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler {
Map<String, Map<dynamic/*String|MessageKind*/, int>> whiteListMap
= new Map<String, Map<dynamic/*String|MessageKind*/, int>>();
+ List<MessageKind> skipList;
CollectingDiagnosticHandler(
Map<String, List/*<String|MessageKind>*/> whiteList,
+ this.skipList,
SourceFileProvider provider)
: super(provider) {
whiteList.forEach((String file, List/*<String|MessageKind>*/ messageParts) {
@@ -89,6 +91,9 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler {
if (uri == null) {
return false;
}
+ if (skipList.contains(message.kind)) {
+ return true;
+ }
String path = uri.path;
for (String file in whiteListMap.keys) {
if (path.contains(file)) {
@@ -169,11 +174,17 @@ enum AnalysisMode {
TREE_SHAKING,
}
+/// Analyzes the file(s) in [uriList] using the provided [mode] and checks that
+/// no messages (errors, warnings or hints) are emitted.
+///
+/// Messages can be generally allowed using [skipList] or on a per-file basis
+/// using [whiteList].
Future analyze(List<Uri> uriList,
Map<String, List/*<String|MessageKind>*/> whiteList,
{AnalysisMode mode: AnalysisMode.ALL,
CheckResults checkResults,
- List<String> options: const <String>[]}) async {
+ List<String> options: const <String>[],
+ List<MessageKind> skipList: const <MessageKind>[]}) async {
String testFileName =
relativize(Uri.base, Platform.script, Platform.isWindows);
@@ -191,7 +202,7 @@ Future analyze(List<Uri> uriList,
var packageRoot =
currentDirectory.resolve(Platform.packageRoot);
var provider = new CompilerSourceFileProvider();
- var handler = new CollectingDiagnosticHandler(whiteList, provider);
+ var handler = new CollectingDiagnosticHandler(whiteList, skipList, provider);
options = <String>[Flags.analyzeOnly, '--categories=Client,Server',
Flags.showPackageWarnings]..addAll(options);
switch (mode) {
« 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