| 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 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 5 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 6 import 'package:analyzer/src/generated/engine.dart'; | 6 import 'package:analyzer/src/generated/engine.dart'; |
| 7 import 'package:test/test.dart'; | 7 import 'package:test/test.dart'; |
| 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 9 | 9 |
| 10 import '../integration_tests.dart'; | 10 import '../integration_tests.dart'; |
| 11 | 11 |
| 12 main() { | 12 main() { |
| 13 defineReflectiveSuite(() { | 13 defineReflectiveSuite(() { |
| 14 defineReflectiveTests(OptionsIntegrationTest); | 14 defineReflectiveTests(OptionsIntegrationTest); |
| 15 defineReflectiveTests(OptionsIntegrationTest_Driver); | |
| 16 }); | 15 }); |
| 17 } | 16 } |
| 18 | 17 |
| 19 class AbstractOptionsIntegrationTest | 18 @reflectiveTest |
| 20 extends AbstractAnalysisServerIntegrationTest { | 19 class OptionsIntegrationTest extends AbstractAnalysisServerIntegrationTest { |
| 20 @failingTest |
| 21 test_option_warning_newOptionFile() async { | 21 test_option_warning_newOptionFile() async { |
| 22 // Test timed out after 30 seconds (#28868). |
| 23 fail('Test timed out'); |
| 24 |
| 22 String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE); | 25 String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE); |
| 23 writeFile( | 26 writeFile( |
| 24 options, | 27 options, |
| 25 ''' | 28 ''' |
| 26 linter: | 29 linter: |
| 27 rules: | 30 rules: |
| 28 - camel_case_typo # :) | 31 - camel_case_typo # :) |
| 29 '''); | 32 '''); |
| 30 | 33 |
| 31 standardAnalysisSetup(); | 34 standardAnalysisSetup(); |
| 32 | 35 |
| 33 await analysisFinished; | 36 await analysisFinished; |
| 34 | 37 |
| 35 expect(currentAnalysisErrors[options], isList); | 38 expect(currentAnalysisErrors[options], isList); |
| 36 List<AnalysisError> errors = currentAnalysisErrors[options]; | 39 List<AnalysisError> errors = currentAnalysisErrors[options]; |
| 37 expect(errors, hasLength(1)); | 40 expect(errors, hasLength(1)); |
| 38 AnalysisError error = errors[0]; | 41 AnalysisError error = errors[0]; |
| 39 expect(error.location.file, options); | 42 expect(error.location.file, options); |
| 40 expect(error.severity, AnalysisErrorSeverity.WARNING); | 43 expect(error.severity, AnalysisErrorSeverity.WARNING); |
| 41 expect(error.type, AnalysisErrorType.STATIC_WARNING); | 44 expect(error.type, AnalysisErrorType.STATIC_WARNING); |
| 42 expect(error.location.offset, 23); | 45 expect(error.location.offset, 23); |
| 43 expect(error.location.length, 'camel_case_typo'.length); | 46 expect(error.location.length, 'camel_case_typo'.length); |
| 44 expect(error.location.startLine, 3); | 47 expect(error.location.startLine, 3); |
| 45 expect(error.location.startColumn, 7); | 48 expect(error.location.startColumn, 7); |
| 46 } | 49 } |
| 47 | 50 |
| 51 @failingTest |
| 48 test_option_warning_oldOptionFile() async { | 52 test_option_warning_oldOptionFile() async { |
| 53 // Test timed out after 30 seconds (#28868). |
| 54 fail('Test timed out'); |
| 55 |
| 49 String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_FILE); | 56 String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_FILE); |
| 50 writeFile( | 57 writeFile( |
| 51 options, | 58 options, |
| 52 ''' | 59 ''' |
| 53 linter: | 60 linter: |
| 54 rules: | 61 rules: |
| 55 - camel_case_typo # :) | 62 - camel_case_typo # :) |
| 56 '''); | 63 '''); |
| 57 | 64 |
| 58 standardAnalysisSetup(); | 65 standardAnalysisSetup(); |
| 59 | 66 |
| 60 await analysisFinished; | 67 await analysisFinished; |
| 61 | 68 |
| 62 expect(currentAnalysisErrors[options], isList); | 69 expect(currentAnalysisErrors[options], isList); |
| 63 List<AnalysisError> errors = currentAnalysisErrors[options]; | 70 List<AnalysisError> errors = currentAnalysisErrors[options]; |
| 64 expect(errors, hasLength(1)); | 71 expect(errors, hasLength(1)); |
| 65 AnalysisError error = errors[0]; | 72 AnalysisError error = errors[0]; |
| 66 expect(error.location.file, options); | 73 expect(error.location.file, options); |
| 67 expect(error.severity, AnalysisErrorSeverity.WARNING); | 74 expect(error.severity, AnalysisErrorSeverity.WARNING); |
| 68 expect(error.type, AnalysisErrorType.STATIC_WARNING); | 75 expect(error.type, AnalysisErrorType.STATIC_WARNING); |
| 69 expect(error.location.offset, 23); | 76 expect(error.location.offset, 23); |
| 70 expect(error.location.length, 'camel_case_typo'.length); | 77 expect(error.location.length, 'camel_case_typo'.length); |
| 71 expect(error.location.startLine, 3); | 78 expect(error.location.startLine, 3); |
| 72 expect(error.location.startColumn, 7); | 79 expect(error.location.startColumn, 7); |
| 73 } | 80 } |
| 74 } | 81 } |
| 75 | |
| 76 @reflectiveTest | |
| 77 class OptionsIntegrationTest extends AbstractOptionsIntegrationTest {} | |
| 78 | |
| 79 @reflectiveTest | |
| 80 class OptionsIntegrationTest_Driver extends AbstractOptionsIntegrationTest { | |
| 81 @override | |
| 82 bool get enableNewAnalysisDriver => true; | |
| 83 | |
| 84 @failingTest | |
| 85 test_option_warning_newOptionFile() async { | |
| 86 // TimeoutException after 0:00:30.000000: Test timed out after 30 seconds. | |
| 87 //return super.test_option_warning_newOptionFile(); | |
| 88 fail('Test timed out'); | |
| 89 } | |
| 90 | |
| 91 @failingTest | |
| 92 test_option_warning_oldOptionFile() async { | |
| 93 // TimeoutException after 0:00:30.000000: Test timed out after 30 seconds. | |
| 94 //return super.test_option_warning_oldOptionFile(); | |
| 95 fail('Test timed out'); | |
| 96 } | |
| 97 } | |
| OLD | NEW |