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

Side by Side Diff: pkg/analyzer/test/src/context/builder_test.dart

Issue 2913493002: Add the analysis options path to the diagnostics page. (Closed)
Patch Set: move the root.optionsFilePath field to the ContextRoot class Created 3 years, 6 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library analyzer.test.src.context.context_builder_test; 5 library analyzer.test.src.context.context_builder_test;
6 6
7 import 'package:analyzer/context/context_root.dart';
7 import 'package:analyzer/file_system/file_system.dart'; 8 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/file_system/memory_file_system.dart'; 9 import 'package:analyzer/file_system/memory_file_system.dart';
9 import 'package:analyzer/source/package_map_resolver.dart'; 10 import 'package:analyzer/source/package_map_resolver.dart';
10 import 'package:analyzer/src/command_line/arguments.dart'; 11 import 'package:analyzer/src/command_line/arguments.dart';
11 import 'package:analyzer/src/context/builder.dart'; 12 import 'package:analyzer/src/context/builder.dart';
12 import 'package:analyzer/src/context/source.dart'; 13 import 'package:analyzer/src/context/source.dart';
13 import 'package:analyzer/src/generated/bazel.dart'; 14 import 'package:analyzer/src/generated/bazel.dart';
14 import 'package:analyzer/src/generated/engine.dart'; 15 import 'package:analyzer/src/generated/engine.dart';
15 import 'package:analyzer/src/generated/sdk.dart'; 16 import 'package:analyzer/src/generated/sdk.dart';
16 import 'package:analyzer/src/generated/source.dart'; 17 import 'package:analyzer/src/generated/source.dart';
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 ''' 886 '''
886 linter: 887 linter:
887 rules: 888 rules:
888 - empty_constructor_bodies 889 - empty_constructor_bodies
889 '''); 890 ''');
890 891
891 AnalysisOptions options = builder.getAnalysisOptions(path); 892 AnalysisOptions options = builder.getAnalysisOptions(path);
892 _expectEqualOptions(options, new AnalysisOptionsImpl()); 893 _expectEqualOptions(options, new AnalysisOptionsImpl());
893 } 894 }
894 895
896 void test_getAnalysisOptions_optionsPath() {
897 String path = resourceProvider.convertPath('/some/directory/path');
898 String filePath =
899 pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
900 resourceProvider.newFile(
901 filePath,
902 '''
903 linter:
904 rules:
905 - empty_constructor_bodies
906 ''');
907
908 ContextRoot root = new ContextRoot(path, []);
909 builder.getAnalysisOptions(path, contextRoot: root);
910 expect(root.optionsFilePath, equals(filePath));
911 }
912
895 void test_getAnalysisOptions_noDefault_overrides() { 913 void test_getAnalysisOptions_noDefault_overrides() {
896 AnalysisOptionsImpl expected = new AnalysisOptionsImpl(); 914 AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
897 expected.enableSuperMixins = true; 915 expected.enableSuperMixins = true;
898 String path = resourceProvider.convertPath('/some/directory/path'); 916 String path = resourceProvider.convertPath('/some/directory/path');
899 String filePath = 917 String filePath =
900 pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE); 918 pathContext.join(path, AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
901 resourceProvider.newFile( 919 resourceProvider.newFile(
902 filePath, 920 filePath,
903 ''' 921 '''
904 analyzer: 922 analyzer:
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 class _MockLintRule implements LintRule { 1077 class _MockLintRule implements LintRule {
1060 final String _name; 1078 final String _name;
1061 1079
1062 _MockLintRule(this._name); 1080 _MockLintRule(this._name);
1063 1081
1064 @override 1082 @override
1065 String get name => _name; 1083 String get name => _name;
1066 1084
1067 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 1085 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
1068 } 1086 }
OLDNEW
« pkg/analyzer/lib/src/context/builder.dart ('K') | « pkg/analyzer/lib/src/context/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698