OLD | NEW |
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 import 'dart:io'; | 5 import 'dart:io'; |
6 import 'package:analyzer/analyzer.dart'; | 6 import 'package:analyzer/analyzer.dart'; |
7 import 'package:analyzer/src/command_line/arguments.dart'; | 7 import 'package:analyzer/src/command_line/arguments.dart'; |
8 import 'package:analyzer/src/summary/summary_sdk.dart'; | 8 import 'package:analyzer/src/summary/summary_sdk.dart'; |
9 import 'package:path/path.dart' as path; | 9 import 'package:path/path.dart' as path; |
10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 test('fromArgs options flag', () { | 72 test('fromArgs options flag', () { |
73 var args = <String>['--$enableStrictCallChecksFlag']; | 73 var args = <String>['--$enableStrictCallChecksFlag']; |
74 //TODO(danrubel) remove sdkSummaryArgs once all SDKs have summary file | 74 //TODO(danrubel) remove sdkSummaryArgs once all SDKs have summary file |
75 args.addAll(sdkSummaryArgs); | 75 args.addAll(sdkSummaryArgs); |
76 var argResults = ddcArgParser().parse(args); | 76 var argResults = ddcArgParser().parse(args); |
77 var options = new AnalyzerOptions.fromArguments(argResults); | 77 var options = new AnalyzerOptions.fromArguments(argResults); |
78 var compiler = new ModuleCompiler(options, analysisRoot: optionsDir); | 78 var compiler = new ModuleCompiler(options, analysisRoot: optionsDir); |
79 var analysisOptions = compiler.context.analysisOptions; | 79 var analysisOptions = compiler.context.analysisOptions; |
80 expect(analysisOptions.enableStrictCallChecks, isTrue); | 80 expect(analysisOptions.enableStrictCallChecks, isTrue); |
81 }); | 81 }); |
| 82 |
| 83 test('custom module name for summary', () { |
| 84 var args = <String>[ |
| 85 '-snormal', |
| 86 '-scustom/path:module', |
| 87 '-sanother', |
| 88 '-scustom/path2:module2' |
| 89 ]; |
| 90 |
| 91 var argResults = ddcArgParser().parse(args); |
| 92 var options = new AnalyzerOptions.fromArguments(argResults); |
| 93 expect(options.summaryPaths, |
| 94 orderedEquals(['normal', 'custom/path', 'another', 'custom/path2'])); |
| 95 expect(options.customSummaryModules['custom/path'], equals('module')); |
| 96 expect(options.customSummaryModules['custom/path2'], equals('module2')); |
| 97 expect(options.customSummaryModules.containsKey('normal'), isFalse); |
| 98 }); |
82 } | 99 } |
OLD | NEW |