| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 import 'package:compiler/src/diagnostics/messages.dart' | 8 import 'package:compiler/src/diagnostics/messages.dart' |
| 9 show MessageKind, MessageTemplate; | 9 show MessageKind, MessageTemplate; |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 name == 'PLEASE_REPORT_THE_CRASH' | 27 name == 'PLEASE_REPORT_THE_CRASH' |
| 28 // We cannot provide examples for patch errors. | 28 // We cannot provide examples for patch errors. |
| 29 || | 29 || |
| 30 name.startsWith('PATCH_') || | 30 name.startsWith('PATCH_') || |
| 31 name == 'LIBRARY_NOT_SUPPORTED' | 31 name == 'LIBRARY_NOT_SUPPORTED' |
| 32 // TODO(johnniwinther): Remove these when [Compiler.reportUnusedCode] is | 32 // TODO(johnniwinther): Remove these when [Compiler.reportUnusedCode] is |
| 33 // reenabled. | 33 // reenabled. |
| 34 || | 34 || |
| 35 name == 'UNUSED_METHOD' || | 35 name == 'UNUSED_METHOD' || |
| 36 name == 'UNUSED_CLASS' || | 36 name == 'UNUSED_CLASS' || |
| 37 name == 'UNUSED_TYPEDEF') continue; | 37 name == 'UNUSED_TYPEDEF' || |
| 38 |
| 39 // Fasta no longer generates EXTRANEOUS_MODIFIER_REPLACE. |
| 40 name == 'EXTRANEOUS_MODIFIER_REPLACE' || |
| 41 |
| 42 // Fasta just reports EXTRANEOUS_MODIFIER. |
| 43 name == 'FORMAL_DECLARED_STATIC' || |
| 44 |
| 45 // Additional warning from dart2js. |
| 46 name == 'VOID_NOT_ALLOWED') continue; |
| 38 if (template.examples != null) { | 47 if (template.examples != null) { |
| 39 examples.add(template); | 48 examples.add(template); |
| 40 } else { | 49 } else { |
| 41 print("No example in '$name'"); | 50 print("No example in '$name'"); |
| 42 } | 51 } |
| 43 } | 52 } |
| 44 ; | 53 ; |
| 45 var cachedCompiler; | 54 var cachedCompiler; |
| 46 asyncTest(() => Future.forEach(examples, (MessageTemplate template) { | 55 asyncTest(() => Future.forEach(examples, (MessageTemplate template) { |
| 47 print("Checking '${template.kind}'."); | 56 print("Checking '${template.kind}'."); |
| 48 Stopwatch sw = new Stopwatch()..start(); | 57 Stopwatch sw = new Stopwatch()..start(); |
| 49 return check(template, cachedCompiler).then((var compiler) { | 58 return check(template, cachedCompiler).then((var compiler) { |
| 50 cachedCompiler = compiler; | 59 cachedCompiler = compiler; |
| 51 sw.stop(); | 60 sw.stop(); |
| 52 print("Checked '${template.kind}' in ${sw.elapsedMilliseconds}ms."); | 61 print("Checked '${template.kind}' in ${sw.elapsedMilliseconds}ms."); |
| 53 }); | 62 }); |
| 54 })); | 63 })); |
| 55 } | 64 } |
| OLD | NEW |