| 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 '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show | 8 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show |
| 9 DualKind, | 9 DualKind, |
| 10 MessageKind; | 10 MessageKind; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // We cannot provide examples for patch errors. | 42 // We cannot provide examples for patch errors. |
| 43 || name.startsWith('PATCH_')) continue; | 43 || name.startsWith('PATCH_')) continue; |
| 44 if (kind.examples != null) { | 44 if (kind.examples != null) { |
| 45 examples.add(name); | 45 examples.add(name); |
| 46 } else { | 46 } else { |
| 47 print("No example in '$name'"); | 47 print("No example in '$name'"); |
| 48 } | 48 } |
| 49 }; | 49 }; |
| 50 var cachedCompiler; | 50 var cachedCompiler; |
| 51 asyncTest(() => Future.forEach(examples, (String name) { | 51 asyncTest(() => Future.forEach(examples, (String name) { |
| 52 print("Checking '$name'."); |
| 52 Stopwatch sw = new Stopwatch()..start(); | 53 Stopwatch sw = new Stopwatch()..start(); |
| 54 bool useCachedCompiler = true; |
| 55 if (name == 'MISSING_LIBRARY_NAME') { |
| 56 // TODO(johnniwinther): Found out why we cannot use the cached compiler |
| 57 // for this message kind. |
| 58 cachedCompiler = null; |
| 59 } |
| 53 return check(kinds[name], cachedCompiler). | 60 return check(kinds[name], cachedCompiler). |
| 54 then((var compiler) { | 61 then((var compiler) { |
| 55 cachedCompiler = compiler; | 62 cachedCompiler = compiler; |
| 56 sw.stop(); | 63 sw.stop(); |
| 57 print("Checked '$name' in ${sw.elapsedMilliseconds}ms."); | 64 print("Checked '$name' in ${sw.elapsedMilliseconds}ms."); |
| 58 }); | 65 }); |
| 59 } | 66 } |
| 60 )); | 67 )); |
| 61 } | 68 } |
| OLD | NEW |