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

Side by Side Diff: pkg/analyzer/test/src/task/strong/strong_test_helper.dart

Issue 1402813005: move strong mode hints behind flag (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/analyzer/test/src/task/dart_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) 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 // TODO(jmesserly): this file needs to be refactored, it's a port from 5 // TODO(jmesserly): this file needs to be refactored, it's a port from
6 // package:dev_compiler's tests 6 // package:dev_compiler's tests
7 library test.src.task.strong.strong_test_helper; 7 library test.src.task.strong.strong_test_helper;
8 8
9 import 'package:analyzer/file_system/file_system.dart'; 9 import 'package:analyzer/file_system/file_system.dart';
10 import 'package:analyzer/file_system/memory_file_system.dart'; 10 import 'package:analyzer/file_system/memory_file_system.dart';
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 new MockDartSdk(mockSdkSources, reportMissing: true).resolver, 68 new MockDartSdk(mockSdkSources, reportMissing: true).resolver,
69 uriResolver 69 uriResolver
70 ]); 70 ]);
71 71
72 // Run the checker on /main.dart. 72 // Run the checker on /main.dart.
73 Source mainSource = uriResolver.resolveAbsolute(new Uri.file('/main.dart')); 73 Source mainSource = uriResolver.resolveAbsolute(new Uri.file('/main.dart'));
74 var initialLibrary = 74 var initialLibrary =
75 context.resolveCompilationUnit2(mainSource, mainSource); 75 context.resolveCompilationUnit2(mainSource, mainSource);
76 76
77 var collector = new _ErrorCollector(); 77 var collector = new _ErrorCollector();
78 var checker = 78 var checker = new CodeChecker(
79 new CodeChecker(new TypeRules(context.typeProvider), collector); 79 new TypeRules(context.typeProvider), collector,
80 hints: true);
80 81
81 // Extract expectations from the comments in the test files, and 82 // Extract expectations from the comments in the test files, and
82 // check that all errors we emit are included in the expected map. 83 // check that all errors we emit are included in the expected map.
83 var allLibraries = reachableLibraries(initialLibrary.element.library); 84 var allLibraries = reachableLibraries(initialLibrary.element.library);
84 for (var lib in allLibraries) { 85 for (var lib in allLibraries) {
85 for (var unit in lib.units) { 86 for (var unit in lib.units) {
86 var errors = <AnalysisError>[]; 87 var errors = <AnalysisError>[];
87 collector.errors = errors; 88 collector.errors = errors;
88 89
89 var source = unit.source; 90 var source = unit.source;
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 if (levelName == 'warning') return _MAGENTA_COLOR; 491 if (levelName == 'warning') return _MAGENTA_COLOR;
491 if (levelName == 'info') return _CYAN_COLOR; 492 if (levelName == 'info') return _CYAN_COLOR;
492 return null; 493 return null;
493 } 494 }
494 495
495 const String _RED_COLOR = '\u001b[31m'; 496 const String _RED_COLOR = '\u001b[31m';
496 const String _MAGENTA_COLOR = '\u001b[35m'; 497 const String _MAGENTA_COLOR = '\u001b[35m';
497 const String _CYAN_COLOR = '\u001b[36m'; 498 const String _CYAN_COLOR = '\u001b[36m';
498 const String GREEN_COLOR = '\u001b[32m'; 499 const String GREEN_COLOR = '\u001b[32m';
499 const String NO_COLOR = '\u001b[0m'; 500 const String NO_COLOR = '\u001b[0m';
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/task/dart_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698