| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.analyze_test.test; | 5 library dart2js.analyze_test.test; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
| 10 import 'package:compiler/src/apiimpl.dart' show | 10 import 'package:compiler/src/apiimpl.dart' show |
| 11 CompilerImpl; | 11 CompilerImpl; |
| 12 import 'package:compiler/src/commandline_options.dart'; | 12 import 'package:compiler/src/commandline_options.dart'; |
| 13 import 'package:compiler/src/diagnostics/messages.dart' show | 13 import 'package:compiler/src/diagnostics/messages.dart' show |
| 14 MessageKind; | 14 MessageKind; |
| 15 import 'package:compiler/src/filenames.dart' show | 15 import 'package:compiler/src/filenames.dart' show |
| 16 nativeToUriPath; | 16 nativeToUriPath; |
| 17 | 17 |
| 18 import 'analyze_helper.dart'; | 18 import 'analyze_helper.dart'; |
| 19 import 'memory_compiler.dart'; | 19 import 'memory_compiler.dart'; |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Map of white-listed warnings and errors. | 22 * Map of white-listed warnings and errors. |
| 23 * | 23 * |
| 24 * Use an identifiable suffix of the file uri as key. Use a fixed substring of | 24 * Use an identifiable suffix of the file uri as key. Use a fixed substring of |
| 25 * the error/warning message in the list of white-listings for each file. | 25 * the error/warning message in the list of white-listings for each file. |
| 26 */ | 26 */ |
| 27 // TODO(johnniwinther): Support canonical URIs as keys. | 27 // TODO(johnniwinther): Support canonical URIs as keys. |
| 28 const Map<String, List/*<String|MessageKind>*/> WHITE_LIST = const { | 28 const Map<String, List/*<String|MessageKind>*/> WHITE_LIST = const { |
| 29 // Several tests import mirrors; any of these might trigger the warning. |
| 30 ".dart": const [ |
| 31 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, |
| 32 ], |
| 29 "/test/src/util/": const [ | 33 "/test/src/util/": const [ |
| 30 "Library 'package:async/async.dart' doesn't export a " | 34 "Library 'package:async/async.dart' doesn't export a " |
| 31 "'ForkableStream' declaration.", | 35 "'ForkableStream' declaration.", |
| 32 ], | 36 ], |
| 37 "mirrors_test.dart": const [ |
| 38 MessageKind.INVALID_SYMBOL, |
| 39 MessageKind.PRIVATE_IDENTIFIER, |
| 40 ], |
| 33 }; | 41 }; |
| 34 | 42 |
| 35 const List<String> SKIP_LIST = const <String>[ | 43 const List<String> SKIP_LIST = const <String>[ |
| 36 // Helper files: | 44 // Helper files: |
| 37 "dart2js_batch2_run.dart", | 45 "dart2js_batch2_run.dart", |
| 38 "http_launch_data/", | 46 "http_launch_data/", |
| 47 "mirrors_helper.dart", |
| 39 "path%20with%20spaces/", | 48 "path%20with%20spaces/", |
| 40 "one_line_dart_program.dart", | 49 "one_line_dart_program.dart", |
| 41 "sourcemaps/invokes_test_file.dart", | 50 "sourcemaps/invokes_test_file.dart", |
| 42 "cps_ir/input/", | 51 "cps_ir/input/", |
| 43 // No longer maintained: | 52 // No longer maintained: |
| 44 "backend_dart/", | 53 "backend_dart/", |
| 45 // Broken tests: | 54 // Broken tests: |
| 46 "http_test.dart", | 55 "http_test.dart", |
| 47 ]; | 56 ]; |
| 48 | 57 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 64 if (entity is File && entity.path.endsWith('.dart')) { | 73 if (entity is File && entity.path.endsWith('.dart')) { |
| 65 Uri file = Uri.base.resolve(nativeToUriPath(entity.path)); | 74 Uri file = Uri.base.resolve(nativeToUriPath(entity.path)); |
| 66 if (!SKIP_LIST.any((skip) => file.path.contains(skip))) { | 75 if (!SKIP_LIST.any((skip) => file.path.contains(skip))) { |
| 67 uriList.add(file); | 76 uriList.add(file); |
| 68 } | 77 } |
| 69 } | 78 } |
| 70 } | 79 } |
| 71 await analyze(uriList, WHITE_LIST, mode: AnalysisMode.URI); | 80 await analyze(uriList, WHITE_LIST, mode: AnalysisMode.URI); |
| 72 }); | 81 }); |
| 73 } | 82 } |
| OLD | NEW |