| OLD | NEW |
| 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 library analyzer_cli.test.driver; | 5 library analyzer_cli.test.driver; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:analyzer/error/error.dart'; | 9 import 'package:analyzer/error/error.dart'; |
| 10 import 'package:analyzer/plugin/options.dart'; | 10 import 'package:analyzer/plugin/options.dart'; |
| 11 import 'package:analyzer/source/analysis_options_provider.dart'; | 11 import 'package:analyzer/source/analysis_options_provider.dart'; |
| 12 import 'package:analyzer/source/error_processor.dart'; | 12 import 'package:analyzer/source/error_processor.dart'; |
| 13 import 'package:analyzer/src/error/codes.dart'; | 13 import 'package:analyzer/src/error/codes.dart'; |
| 14 import 'package:analyzer/src/generated/engine.dart'; | 14 import 'package:analyzer/src/generated/engine.dart'; |
| 15 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
| 16 import 'package:analyzer/src/services/lint.dart'; | 16 import 'package:analyzer/src/services/lint.dart'; |
| 17 import 'package:analyzer/src/task/options.dart'; | |
| 18 import 'package:analyzer_cli/src/driver.dart'; | 17 import 'package:analyzer_cli/src/driver.dart'; |
| 19 import 'package:analyzer_cli/src/options.dart'; | 18 import 'package:analyzer_cli/src/options.dart'; |
| 20 import 'package:path/path.dart' as path; | 19 import 'package:path/path.dart' as path; |
| 21 import 'package:plugin/plugin.dart'; | 20 import 'package:plugin/plugin.dart'; |
| 22 import 'package:test/test.dart'; | 21 import 'package:test/test.dart'; |
| 23 import 'package:yaml/src/yaml_node.dart'; | 22 import 'package:yaml/src/yaml_node.dart'; |
| 24 | 23 |
| 25 import 'utils.dart'; | 24 import 'utils.dart'; |
| 26 | 25 |
| 27 main() { | 26 main() { |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // }); | 419 // }); |
| 421 }); | 420 }); |
| 422 } | 421 } |
| 423 | 422 |
| 424 const emptyOptionsFile = 'data/empty_options.yaml'; | 423 const emptyOptionsFile = 'data/empty_options.yaml'; |
| 425 | 424 |
| 426 /// Shared driver. | 425 /// Shared driver. |
| 427 Driver driver; | 426 Driver driver; |
| 428 | 427 |
| 429 List<ErrorProcessor> get processors => | 428 List<ErrorProcessor> get processors => |
| 430 driver.context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS); | 429 driver.context.analysisOptions.errorProcessors; |
| 431 | 430 |
| 432 /// Convert a file specification from a relative path to an absolute path. | 431 /// Convert a file specification from a relative path to an absolute path. |
| 433 /// Handles the case where the file specification is of the form "$uri|$path". | 432 /// Handles the case where the file specification is of the form "$uri|$path". |
| 434 String adjustFileSpec(String fileSpec) { | 433 String adjustFileSpec(String fileSpec) { |
| 435 int uriPrefixLength = fileSpec.indexOf('|') + 1; | 434 int uriPrefixLength = fileSpec.indexOf('|') + 1; |
| 436 String uriPrefix = fileSpec.substring(0, uriPrefixLength); | 435 String uriPrefix = fileSpec.substring(0, uriPrefixLength); |
| 437 String relativePath = fileSpec.substring(uriPrefixLength); | 436 String relativePath = fileSpec.substring(uriPrefixLength); |
| 438 return '$uriPrefix${path.join(testDirectory, relativePath)}'; | 437 return '$uriPrefix${path.join(testDirectory, relativePath)}'; |
| 439 } | 438 } |
| 440 | 439 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 this.options = options; | 534 this.options = options; |
| 536 } | 535 } |
| 537 } | 536 } |
| 538 | 537 |
| 539 class TestSource implements Source { | 538 class TestSource implements Source { |
| 540 TestSource(); | 539 TestSource(); |
| 541 | 540 |
| 542 @override | 541 @override |
| 543 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 542 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 544 } | 543 } |
| OLD | NEW |