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 // TimeoutException after 0:00:30.000000: Test timed out after 30 seconds |
| 23 // (#28868). |
| 24 |
| 25 fail('test timeout expected - #28868'); |
| 26 |
22 String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE); | 27 String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE); |
23 writeFile( | 28 writeFile( |
24 options, | 29 options, |
25 ''' | 30 ''' |
26 linter: | 31 linter: |
27 rules: | 32 rules: |
28 - camel_case_typo # :) | 33 - camel_case_typo # :) |
29 '''); | 34 '''); |
30 | 35 |
31 standardAnalysisSetup(); | 36 standardAnalysisSetup(); |
32 | 37 |
33 await analysisFinished; | 38 await analysisFinished; |
34 | 39 |
35 expect(currentAnalysisErrors[options], isList); | 40 expect(currentAnalysisErrors[options], isList); |
36 List<AnalysisError> errors = currentAnalysisErrors[options]; | 41 List<AnalysisError> errors = currentAnalysisErrors[options]; |
37 expect(errors, hasLength(1)); | 42 expect(errors, hasLength(1)); |
38 AnalysisError error = errors[0]; | 43 AnalysisError error = errors[0]; |
39 expect(error.location.file, options); | 44 expect(error.location.file, options); |
40 expect(error.severity, AnalysisErrorSeverity.WARNING); | 45 expect(error.severity, AnalysisErrorSeverity.WARNING); |
41 expect(error.type, AnalysisErrorType.STATIC_WARNING); | 46 expect(error.type, AnalysisErrorType.STATIC_WARNING); |
42 expect(error.location.offset, 23); | 47 expect(error.location.offset, 23); |
43 expect(error.location.length, 'camel_case_typo'.length); | 48 expect(error.location.length, 'camel_case_typo'.length); |
44 expect(error.location.startLine, 3); | 49 expect(error.location.startLine, 3); |
45 expect(error.location.startColumn, 7); | 50 expect(error.location.startColumn, 7); |
46 } | 51 } |
47 | 52 |
| 53 @failingTest |
48 test_option_warning_oldOptionFile() async { | 54 test_option_warning_oldOptionFile() async { |
| 55 // TimeoutException after 0:00:30.000000: Test timed out after 30 seconds |
| 56 // (#28868). |
| 57 |
| 58 fail('test timeout expected - #28868'); |
| 59 |
49 String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_FILE); | 60 String options = sourcePath(AnalysisEngine.ANALYSIS_OPTIONS_FILE); |
50 writeFile( | 61 writeFile( |
51 options, | 62 options, |
52 ''' | 63 ''' |
53 linter: | 64 linter: |
54 rules: | 65 rules: |
55 - camel_case_typo # :) | 66 - camel_case_typo # :) |
56 '''); | 67 '''); |
57 | 68 |
58 standardAnalysisSetup(); | 69 standardAnalysisSetup(); |
59 | 70 |
60 await analysisFinished; | 71 await analysisFinished; |
61 | 72 |
62 expect(currentAnalysisErrors[options], isList); | 73 expect(currentAnalysisErrors[options], isList); |
63 List<AnalysisError> errors = currentAnalysisErrors[options]; | 74 List<AnalysisError> errors = currentAnalysisErrors[options]; |
64 expect(errors, hasLength(1)); | 75 expect(errors, hasLength(1)); |
65 AnalysisError error = errors[0]; | 76 AnalysisError error = errors[0]; |
66 expect(error.location.file, options); | 77 expect(error.location.file, options); |
67 expect(error.severity, AnalysisErrorSeverity.WARNING); | 78 expect(error.severity, AnalysisErrorSeverity.WARNING); |
68 expect(error.type, AnalysisErrorType.STATIC_WARNING); | 79 expect(error.type, AnalysisErrorType.STATIC_WARNING); |
69 expect(error.location.offset, 23); | 80 expect(error.location.offset, 23); |
70 expect(error.location.length, 'camel_case_typo'.length); | 81 expect(error.location.length, 'camel_case_typo'.length); |
71 expect(error.location.startLine, 3); | 82 expect(error.location.startLine, 3); |
72 expect(error.location.startColumn, 7); | 83 expect(error.location.startColumn, 7); |
73 } | 84 } |
74 } | 85 } |
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 // (#28868). | |
88 //return super.test_option_warning_newOptionFile(); | |
89 fail('Test timed out'); | |
90 } | |
91 | |
92 @failingTest | |
93 test_option_warning_oldOptionFile() async { | |
94 // TimeoutException after 0:00:30.000000: Test timed out after 30 seconds | |
95 // (#28868). | |
96 //return super.test_option_warning_oldOptionFile(); | |
97 fail('Test timed out'); | |
98 } | |
99 } | |
OLD | NEW |