| 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 "package:async_helper/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 21 matching lines...) Expand all Loading... |
| 36 || name == 'PLEASE_REPORT_THE_CRASH' | 39 || name == 'PLEASE_REPORT_THE_CRASH' |
| 37 // We cannot provide examples for patch errors. | 40 // We cannot provide examples for patch errors. |
| 38 || name.startsWith('PATCH_')) continue; | 41 || name.startsWith('PATCH_')) continue; |
| 39 if (kind.examples != null) { | 42 if (kind.examples != null) { |
| 40 examples.add(name); | 43 examples.add(name); |
| 41 } else { | 44 } else { |
| 42 print("No example in '$name'"); | 45 print("No example in '$name'"); |
| 43 } | 46 } |
| 44 }; | 47 }; |
| 45 var cachedCompiler; | 48 var cachedCompiler; |
| 46 for (String name in examples) { | 49 asyncTest(() => Future.forEach(examples, (String name) { |
| 47 Stopwatch sw = new Stopwatch()..start(); | 50 Stopwatch sw = new Stopwatch()..start(); |
| 48 cachedCompiler = check(kinds[name], cachedCompiler); | 51 return check(kinds[name], cachedCompiler). |
| 49 sw.stop(); | 52 then((var compiler) { |
| 50 print("Checked '$name' in ${sw.elapsedMilliseconds}ms."); | 53 cachedCompiler = compiler; |
| 51 } | 54 sw.stop(); |
| 55 print("Checked '$name' in ${sw.elapsedMilliseconds}ms."); |
| 56 }); |
| 57 } |
| 58 )); |
| 52 } | 59 } |
| OLD | NEW |