Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: tests/compiler/dart2js/message_kind_test.dart

Issue 1338783002: Show import chains for unsupported dart:* library imports. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update cf. comments. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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' show 8 import 'package:compiler/src/diagnostics/messages.dart' show
9 MessageKind, 9 MessageKind,
10 MessageTemplate; 10 MessageTemplate;
11 11
12 import 'message_kind_helper.dart'; 12 import 'message_kind_helper.dart';
13 13
14 main(List<String> arguments) { 14 main(List<String> arguments) {
15 List<MessageTemplate> examples = <MessageTemplate>[]; 15 List<MessageTemplate> examples = <MessageTemplate>[];
16 for (MessageKind kind in MessageKind.values) { 16 for (MessageKind kind in MessageKind.values) {
17 MessageTemplate template = MessageTemplate.TEMPLATES[kind]; 17 MessageTemplate template = MessageTemplate.TEMPLATES[kind];
18 Expect.isNotNull(template, "No template for $kind."); 18 Expect.isNotNull(template, "No template for $kind.");
19 Expect.equals(kind, template.kind, 19 Expect.equals(kind, template.kind,
20 "Invalid MessageTemplate.kind for $kind, found ${template.kind}."); 20 "Invalid MessageTemplate.kind for $kind, found ${template.kind}.");
21 21
22 String name = '${kind.toString()}'.substring('MessageKind.'.length); 22 String name = '${kind.toString()}'.substring('MessageKind.'.length);
23 if (!arguments.isEmpty && !arguments.contains(name)) continue; 23 if (!arguments.isEmpty && !arguments.contains(name)) continue;
24 if (name == 'GENERIC' // Shouldn't be used. 24 if (name == 'GENERIC' // Shouldn't be used.
25 // We can't provoke a crash. 25 // We can't provoke a crash.
26 || name == 'COMPILER_CRASHED' 26 || name == 'COMPILER_CRASHED'
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 || name.startsWith('PATCH_')) continue; 29 || name.startsWith('PATCH_')
30 || name == 'LIBRARY_NOT_SUPPORTED') continue;
30 if (template.examples != null) { 31 if (template.examples != null) {
31 examples.add(template); 32 examples.add(template);
32 } else { 33 } else {
33 print("No example in '$name'"); 34 print("No example in '$name'");
34 } 35 }
35 }; 36 };
36 var cachedCompiler; 37 var cachedCompiler;
37 asyncTest(() => Future.forEach(examples, (MessageTemplate template) { 38 asyncTest(() => Future.forEach(examples, (MessageTemplate template) {
38 print("Checking '${template.kind}'."); 39 print("Checking '${template.kind}'.");
39 Stopwatch sw = new Stopwatch()..start(); 40 Stopwatch sw = new Stopwatch()..start();
40 return check(template, cachedCompiler).then((var compiler) { 41 return check(template, cachedCompiler).then((var compiler) {
41 cachedCompiler = compiler; 42 cachedCompiler = compiler;
42 sw.stop(); 43 sw.stop();
43 print("Checked '${template.kind}' in ${sw.elapsedMilliseconds}ms."); 44 print("Checked '${template.kind}' in ${sw.elapsedMilliseconds}ms.");
44 }); 45 });
45 })); 46 }));
46 } 47 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | tests/compiler/dart2js/missing_file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698