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

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

Issue 1660703002: Share the first error messages. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove bad export. Created 4 years, 10 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
« no previous file with comments | « pkg/dart_messages/test/dart_messages_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SharedMessageKind;
12 11
13 import 'message_kind_helper.dart'; 12 import 'message_kind_helper.dart';
14 13
15 main(List<String> arguments) { 14 main(List<String> arguments) {
16 List<MessageTemplate> examples = <MessageTemplate>[]; 15 List<MessageTemplate> examples = <MessageTemplate>[];
17 List allMessageKinds = [] 16 for (var kind in MessageKind.values) {
18 ..addAll(MessageKind.values)
19 ..addAll(SharedMessageKind.values);
20 for (var kind in allMessageKinds) {
21 if (kind == SharedMessageKind.exampleMessage) continue;
22
23 MessageTemplate template = MessageTemplate.TEMPLATES[kind]; 17 MessageTemplate template = MessageTemplate.TEMPLATES[kind];
24 Expect.isNotNull(template, "No template for $kind."); 18 Expect.isNotNull(template, "No template for $kind.");
25 Expect.equals(kind, template.kind, 19 Expect.equals(kind, template.kind,
26 "Invalid MessageTemplate.kind for $kind, found ${template.kind}."); 20 "Invalid MessageTemplate.kind for $kind, found ${template.kind}.");
27 21
28 String name = '${kind.toString()}'.substring('MessageKind.'.length); 22 String name = '${kind.toString()}'.substring('MessageKind.'.length);
29 if (!arguments.isEmpty && !arguments.contains(name)) continue; 23 if (!arguments.isEmpty && !arguments.contains(name)) continue;
30 if (name == 'GENERIC' // Shouldn't be used. 24 if (name == 'GENERIC' // Shouldn't be used.
31 // We can't provoke a crash. 25 // We can't provoke a crash.
32 || name == 'COMPILER_CRASHED' 26 || name == 'COMPILER_CRASHED'
(...skipping 16 matching lines...) Expand all
49 asyncTest(() => Future.forEach(examples, (MessageTemplate template) { 43 asyncTest(() => Future.forEach(examples, (MessageTemplate template) {
50 print("Checking '${template.kind}'."); 44 print("Checking '${template.kind}'.");
51 Stopwatch sw = new Stopwatch()..start(); 45 Stopwatch sw = new Stopwatch()..start();
52 return check(template, cachedCompiler).then((var compiler) { 46 return check(template, cachedCompiler).then((var compiler) {
53 cachedCompiler = compiler; 47 cachedCompiler = compiler;
54 sw.stop(); 48 sw.stop();
55 print("Checked '${template.kind}' in ${sw.elapsedMilliseconds}ms."); 49 print("Checked '${template.kind}' in ${sw.elapsedMilliseconds}ms.");
56 }); 50 });
57 })); 51 }));
58 } 52 }
OLDNEW
« no previous file with comments | « pkg/dart_messages/test/dart_messages_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698