| 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'; |
| 6 import 'dart:async'; |
| 7 import '../../async_helper.dart'; |
| 5 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show | 8 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show |
| 6 DualKind, | 9 DualKind, |
| 7 MessageKind; | 10 MessageKind; |
| 8 | 11 |
| 9 import 'message_kind_helper.dart'; | 12 import 'message_kind_helper.dart'; |
| 10 | 13 |
| 11 import 'dart:mirrors'; | 14 import 'dart:mirrors'; |
| 12 | 15 |
| 13 main() { | 16 main() { |
| 14 ClassMirror cls = reflectClass(MessageKind); | 17 ClassMirror cls = reflectClass(MessageKind); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 42 || name == 'PLEASE_REPORT_THE_CRASH' | 45 || name == 'PLEASE_REPORT_THE_CRASH' |
| 43 // We cannot provide examples for patch errors. | 46 // We cannot provide examples for patch errors. |
| 44 || name.startsWith('PATCH_')) continue; | 47 || name.startsWith('PATCH_')) continue; |
| 45 if (kind.examples != null) { | 48 if (kind.examples != null) { |
| 46 examples[name] = expectNoHowToFix; | 49 examples[name] = expectNoHowToFix; |
| 47 } else { | 50 } else { |
| 48 print("No example in '$name'"); | 51 print("No example in '$name'"); |
| 49 } | 52 } |
| 50 }; | 53 }; |
| 51 var cachedCompiler; | 54 var cachedCompiler; |
| 52 examples.forEach((String name, bool expectNoHowToFix) { | 55 asyncTest(() => Future.forEach(examples.keys, (String name) { |
| 56 bool expectNoHowToFix = examples[name]; |
| 53 Stopwatch sw = new Stopwatch()..start(); | 57 Stopwatch sw = new Stopwatch()..start(); |
| 54 cachedCompiler = check(kinds[name], cachedCompiler, | 58 return check(kinds[name], |
| 55 expectNoHowToFix: expectNoHowToFix); | 59 cachedCompiler, expectNoHowToFix: expectNoHowToFix). |
| 56 sw.stop(); | 60 then((var compiler) { |
| 57 print("Checked '$name' in ${sw.elapsedMilliseconds}ms."); | 61 cachedCompiler = compiler; |
| 58 }); | 62 sw.stop(); |
| 59 } | 63 print("Checked '$name' in ${sw.elapsedMilliseconds}ms."); |
| 64 }); |
| 65 } |
| 66 )); |
| 67 } |
| OLD | NEW |