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

Unified Diff: tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart

Issue 1769013002: Add white-listing to sourcemap tests. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
Index: tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart
diff --git a/tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart b/tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart
index d93515015878b5260769ed0e16b8fb53757ac6d4..6134d20ef56f433c17b27f4bb2629c5ce0ad91e8 100644
--- a/tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart
+++ b/tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart
@@ -10,7 +10,23 @@ import 'package:compiler/src/js/js_debug.dart';
import 'package:js_ast/js_ast.dart';
import 'sourcemap_helper.dart';
+typedef CodePointWhiteListFunction WhiteListFunction(
+ String configuration, String file);
+
+typedef bool CodePointWhiteListFunction(CodePoint codePoint);
+
+CodePointWhiteListFunction emptyWhiteListFunction(String config, String file) {
+ return emptyWhiteList;
+}
+
+bool emptyWhiteList(CodePoint codePoint) => false;
+
main(List<String> arguments) {
+ test(arguments);
+}
+
+void test(List<String> arguments,
+ {WhiteListFunction whiteListFunction: emptyWhiteListFunction}) {
Set<String> configurations = new Set<String>();
Set<String> files = new Set<String>();
for (String argument in arguments) {
@@ -33,10 +49,12 @@ main(List<String> arguments) {
List<String> options = TEST_CONFIGURATIONS[config];
for (String file in files) {
String filename = TEST_FILES[file];
- TestResult result = await runTests(config, filename, options);
+ TestResult result = await runTests(
+ config, filename, options);
if (result.missingCodePointsMap.isNotEmpty) {
- result.printMissingCodePoints();
- errorsFound = true;
+ errorsFound = result.printMissingCodePoints(
+ whiteListFunction(config, file));
+ true;
}
if (result.multipleNodesMap.isNotEmpty) {
result.printMultipleNodes();
@@ -158,14 +176,22 @@ class TestResult {
TestResult(this.config, this.file, this.processor);
- void printMissingCodePoints() {
+ bool printMissingCodePoints(
+ [CodePointWhiteListFunction codePointWhiteList = emptyWhiteList]) {
+ bool allWhiteListed = true;
missingCodePointsMap.forEach((info, missingCodePoints) {
print("Missing code points for ${info.element} in '$file' "
"in config '$config':");
for (CodePoint codePoint in missingCodePoints) {
- print(" $codePoint");
+ if (codePointWhiteList(codePoint)) {
+ print(" $codePoint (white-listed)");
+ } else {
+ print(" $codePoint");
+ allWhiteListed = false;
+ }
}
});
+ return !allWhiteListed;
}
void printMultipleNodes() {

Powered by Google App Engine
This is Rietveld 408576698