| 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'; | 17 import 'package:analyzer/src/task/options.dart'; |
| 18 import 'package:analyzer_cli/src/driver.dart'; | 18 import 'package:analyzer_cli/src/driver.dart'; |
| 19 import 'package:analyzer_cli/src/options.dart'; | 19 import 'package:analyzer_cli/src/options.dart'; |
| 20 import 'package:path/path.dart' as path; | 20 import 'package:path/path.dart' as path; |
| 21 import 'package:plugin/plugin.dart'; | 21 import 'package:plugin/plugin.dart'; |
| 22 import 'package:unittest/unittest.dart'; | 22 import 'package:test/test.dart'; |
| 23 import 'package:yaml/src/yaml_node.dart'; | 23 import 'package:yaml/src/yaml_node.dart'; |
| 24 | 24 |
| 25 import 'utils.dart'; | 25 import 'utils.dart'; |
| 26 | 26 |
| 27 main() { | 27 main() { |
| 28 StringSink savedOutSink, savedErrorSink; | 28 StringSink savedOutSink, savedErrorSink; |
| 29 int savedExitCode; | 29 int savedExitCode; |
| 30 ExitHandler savedExitHandler; | 30 ExitHandler savedExitHandler; |
| 31 | 31 |
| 32 /// Base setup. | 32 /// Base setup. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 45 outSink = savedOutSink; | 45 outSink = savedOutSink; |
| 46 errorSink = savedErrorSink; | 46 errorSink = savedErrorSink; |
| 47 exitCode = savedExitCode; | 47 exitCode = savedExitCode; |
| 48 exitHandler = savedExitHandler; | 48 exitHandler = savedExitHandler; |
| 49 } | 49 } |
| 50 | 50 |
| 51 setUp(() => _setUp()); | 51 setUp(() => _setUp()); |
| 52 | 52 |
| 53 tearDown(() => _tearDown()); | 53 tearDown(() => _tearDown()); |
| 54 | 54 |
| 55 initializeTestEnvironment(); | |
| 56 | |
| 57 group('Driver', () { | 55 group('Driver', () { |
| 58 group('options', () { | 56 group('options', () { |
| 59 test('custom processor', () { | 57 test('custom processor', () { |
| 60 Driver driver = new Driver(); | 58 Driver driver = new Driver(); |
| 61 TestProcessor processor = new TestProcessor(); | 59 TestProcessor processor = new TestProcessor(); |
| 62 driver.userDefinedPlugins = [new TestPlugin(processor)]; | 60 driver.userDefinedPlugins = [new TestPlugin(processor)]; |
| 63 driver.start([ | 61 driver.start([ |
| 64 '--options', | 62 '--options', |
| 65 path.join(testDirectory, 'data/test_options.yaml'), | 63 path.join(testDirectory, 'data/test_options.yaml'), |
| 66 path.join(testDirectory, 'data/test_file.dart') | 64 path.join(testDirectory, 'data/test_file.dart') |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 this.options = options; | 535 this.options = options; |
| 538 } | 536 } |
| 539 } | 537 } |
| 540 | 538 |
| 541 class TestSource implements Source { | 539 class TestSource implements Source { |
| 542 TestSource(); | 540 TestSource(); |
| 543 | 541 |
| 544 @override | 542 @override |
| 545 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 543 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 546 } | 544 } |
| OLD | NEW |