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

Side by Side Diff: lib/src/report.dart

Issue 1321103002: makes tests faster, see #304 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: stabalize messages 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
« no previous file with comments | « lib/src/compiler.dart ('k') | test/codegen/expect/js_test.txt » ('j') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// Summarizes the information produced by the checker. 5 /// Summarizes the information produced by the checker.
6 library dev_compiler.src.report; 6 library dev_compiler.src.report;
7 7
8 import 'dart:math' show max; 8 import 'dart:math' show max;
9 9
10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
(...skipping 16 matching lines...) Expand all
27 27
28 /// Flushes errors to the log. Until this is called, errors are buffered. 28 /// Flushes errors to the log. Until this is called, errors are buffered.
29 void flush() { 29 void flush() {
30 // TODO(jmesserly): this code was taken from analyzer_cli. 30 // TODO(jmesserly): this code was taken from analyzer_cli.
31 // sort errors 31 // sort errors
32 _errors.sort((AnalysisError error1, AnalysisError error2) { 32 _errors.sort((AnalysisError error1, AnalysisError error2) {
33 // severity 33 // severity
34 var severity1 = _strongModeErrorSeverity(error1); 34 var severity1 = _strongModeErrorSeverity(error1);
35 var severity2 = _strongModeErrorSeverity(error2); 35 var severity2 = _strongModeErrorSeverity(error2);
36 int compare = severity2.compareTo(severity1); 36 int compare = severity2.compareTo(severity1);
37 if (compare != 0) { 37 if (compare != 0) return compare;
38 return compare; 38
39 }
40 // path 39 // path
41 compare = Comparable.compare(error1.source.fullName.toLowerCase(), 40 compare = Comparable.compare(error1.source.fullName.toLowerCase(),
42 error2.source.fullName.toLowerCase()); 41 error2.source.fullName.toLowerCase());
43 if (compare != 0) { 42 if (compare != 0) return compare;
44 return compare; 43
45 }
46 // offset 44 // offset
47 return error1.offset - error2.offset; 45 compare = error1.offset - error2.offset;
46 if (compare != 0) return compare;
47
48 // compare message, in worst case.
49 return error1.message.compareTo(error2.message);
vsm 2015/08/28 17:12:31 nice :-)
48 }); 50 });
49 51
50 _errors.forEach(listener.onError); 52 _errors.forEach(listener.onError);
51 _errors.clear(); 53 _errors.clear();
52 } 54 }
53 55
54 void onError(AnalysisError error) { 56 void onError(AnalysisError error) {
55 _errors.add(error); 57 _errors.add(error);
56 } 58 }
57 } 59 }
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 353
352 visitMessage(MessageSummary message) { 354 visitMessage(MessageSummary message) {
353 var kind = message.kind; 355 var kind = message.kind;
354 errorCount.putIfAbsent(currentPackage, () => <String, int>{}); 356 errorCount.putIfAbsent(currentPackage, () => <String, int>{});
355 errorCount[currentPackage].putIfAbsent(kind, () => 0); 357 errorCount[currentPackage].putIfAbsent(kind, () => 0);
356 errorCount[currentPackage][kind]++; 358 errorCount[currentPackage][kind]++;
357 totals.putIfAbsent(kind, () => 0); 359 totals.putIfAbsent(kind, () => 0);
358 totals[kind]++; 360 totals[kind]++;
359 } 361 }
360 } 362 }
OLDNEW
« no previous file with comments | « lib/src/compiler.dart ('k') | test/codegen/expect/js_test.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698