Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Side by Side Diff: pkg/dev_compiler/test/browser/language_tests.js

Issue 2634433002: Skip fewer tests (Closed)
Patch Set: Add comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 define(['dart_sdk', 'async_helper', 'expect', 'unittest', 'is', 'require'], 5 define(['dart_sdk', 'async_helper', 'expect', 'unittest', 'is', 'require'],
6 function(dart_sdk, async_helper, expect, unittest, is, require) { 6 function(dart_sdk, async_helper, expect, unittest, is, require) {
7 'use strict'; 7 'use strict';
8 8
9 async_helper = async_helper.async_helper; 9 async_helper = async_helper.async_helper;
10 let minitest = expect.minitest; 10 let minitest = expect.minitest;
11 11 let mochaOnError = window.onerror;
12 dart_sdk.dart.trapRuntimeErrors(false); 12 dart_sdk.dart.trapRuntimeErrors(false);
13 dart_sdk._isolate_helper.startRootIsolate(function() {}, []); 13 dart_sdk._isolate_helper.startRootIsolate(function() {}, []);
14 let html_config = unittest.html_config; 14 let html_config = unittest.html_config;
15 // Test attributes are a list of strings, or a string for a single 15 // Test attributes are a list of strings, or a string for a single
16 // attribute. Valid attributes are: 16 // attribute. Valid attributes are:
17 // 17 //
18 // 'pass' - test passes (default) 18 // 'pass' - test passes (default)
19 // 'skip' - don't run the test 19 // 'skip' - don't run the test
20 // 'fail' - test fails 20 // 'fail' - test fails
21 // 'timeout' - test times out 21 // 'timeout' - test times out
22 // 'slow' - use 5s timeout instead of default 2s. 22 // 'slow' - use 5s timeout instead of default 2s.
23 // 'helper' - not a test, used by other tests. 23 // 'helper' - not a test, used by other tests.
24 // 'unittest' - run separately as a unittest test. 24 // 'unittest' - run separately as a unittest test.
25 // 25 //
26 // Common combinations: 26 // Common combinations:
27 const pass = 'pass'; 27 const pass = 'pass';
28 const fail = 'fail'; 28 const fail = 'fail';
29 const skip_fail = ['skip', 'fail'];
30 const skip_timeout = ['skip', 'timeout']; 29 const skip_timeout = ['skip', 'timeout'];
31 30
32 // Browsers 31 // Browsers
33 const firefox_fail = is.firefox() ? fail : pass; 32 const firefox_fail = is.firefox() ? fail : pass;
34 const chrome_fail = is.chrome() ? fail : pass; 33 const chrome_fail = is.chrome() ? fail : pass;
35 34
36 // Tests marked with this are still using the deprecated unittest package 35 // Tests marked with this are still using the deprecated unittest package
37 // because they rely on its support for futures and asynchronous tests, which 36 // because they rely on its support for futures and asynchronous tests, which
38 // expect and minitest do not handle. 37 // expect and minitest do not handle.
39 // TODO(rnystrom): Move all of these away from using the async test API so 38 // TODO(rnystrom): Move all of these away from using the async test API so
40 // they can stop using unittest. 39 // they can stop using unittest.
41 const async_unittest = ['unittest', 'skip', 'fail']; 40 const async_unittest = ['unittest', 'skip', 'fail'];
42 41
43 // The number of expected unittest errors should be zero but unfortunately 42 // The number of expected unittest errors should be zero but unfortunately
44 // there are a lot of broken html unittests. 43 // there are a lot of broken html unittests.
45 let num_expected_unittest_fails = 3; 44 let num_expected_unittest_fails = 3;
46 let num_expected_unittest_errors = 0; 45 let num_expected_unittest_errors = 0;
47 46
48 // TODO(jmesserly): separate StrongModeError from other errors. 47 // TODO(jmesserly): separate StrongModeError from other errors.
49 let all_status = { 48 let all_status = {
50 'language': { 49 'language': {
51 'assert_with_type_test_or_cast_test': skip_fail, 50 'assertion_test': fail,
52 'assertion_test': skip_fail,
53 'async_await_test_none_multi': 'unittest', 51 'async_await_test_none_multi': 'unittest',
54 'async_await_test_02_multi': 'unittest', 52 'async_await_test_02_multi': 'unittest',
55 53
56 // Flaky on travis (https://github.com/dart-lang/sdk/issues/27224) 54 // Flaky on travis (https://github.com/dart-lang/sdk/issues/27224)
57 'async_await_test_03_multi': skip_fail, 55 'async_await_test_03_multi': async_unittest,
58 56
59 'async_star_await_pauses_test': skip_fail, 57 'async_star_await_pauses_test': skip_timeout,
60 58
61 // TODO(jmesserly): figure out why this test is hanging. 59 // TODO(jmesserly): figure out why this test is hanging.
62 'async_star_cancel_and_throw_in_finally_test': skip_timeout, 60 'async_star_cancel_and_throw_in_finally_test': skip_timeout,
63 61
64 'async_star_cancel_while_paused_test': skip_fail, 62 'async_star_cancel_while_paused_test': fail,
65 'async_star_regression_fisk_test': skip_fail,
66 63
67 // TODO(vsm): Re-enable (https://github.com/dart-lang/sdk/issues/28319) 64 // TODO(vsm): Re-enable (https://github.com/dart-lang/sdk/issues/28319)
68 'async_star_test_none_multi': ['unittest', 'skip', 'fail'], 65 'async_star_test_none_multi': async_unittest,
69 'async_star_test_01_multi': ['unittest', 'skip', 'fail'], 66 'async_star_test_01_multi': async_unittest,
70 'async_star_test_02_multi': ['unittest', 'skip', 'fail'], 67 'async_star_test_02_multi': async_unittest,
71 'async_star_test_03_multi': ['unittest', 'skip', 'fail'], 68 'async_star_test_03_multi': async_unittest,
72 'async_star_test_04_multi': ['unittest', 'skip', 'fail'], 69 'async_star_test_04_multi': async_unittest,
73 'async_star_test_05_multi': ['unittest', 'skip', 'fail'], 70 'async_star_test_05_multi': async_unittest,
74 71
75 'async_switch_test': skip_fail, 72 'async_switch_test': fail,
76 'asyncstar_throw_in_catch_test': skip_fail, 73 'asyncstar_throw_in_catch_test': fail,
77 'await_future_test': skip_fail, 74 'await_future_test': skip_timeout,
78 'bit_operations_test_none_multi': skip_fail, // DDC/dart2js canonicalize bitop results to unsigned 75 'bit_operations_test_none_multi': fail, // DDC/dart2js canonicalize bitop results to unsigned
79 'bool_test': skip_fail, 76 'branch_canonicalization_test': fail, // JS bit operations truncate to 32 bits.
80 'branch_canonicalization_test': skip_fail, // JS bit operations truncate to 32 bits.
81 'call_closurization_test': fail, // Functions do not expose a "call" metho d. 77 'call_closurization_test': fail, // Functions do not expose a "call" metho d.
82 'call_function_apply_test': fail, // Function.apply not really implemented . 78 'call_function_apply_test': fail, // Function.apply not really implemented .
83 'call_through_null_getter_test': fail, // null errors are not converted to NoSuchMethodErrors. 79 'call_through_null_getter_test': fail, // null errors are not converted to NoSuchMethodErrors.
84 'call_with_no_such_method_test': fail, // Function.apply not really implem ented. 80 'call_with_no_such_method_test': fail, // Function.apply not really implem ented.
85 'canonical_const2_test': skip_fail, 81 'canonical_const2_test': fail,
86 'canonical_const_test': skip_fail, 82 'canonical_const_test': fail,
87 'cascade_precedence_test': skip_fail, 83 'cast_test_01_multi': fail,
88 'cast_test_01_multi': skip_fail, 84 'cast_test_02_multi': fail,
89 'cast_test_02_multi': skip_fail, 85 'cast_test_03_multi': fail,
90 'cast_test_03_multi': skip_fail, 86 'cast_test_07_multi': fail,
91 'cast_test_07_multi': skip_fail, 87 'cast_test_10_multi': fail,
92 'cast_test_10_multi': skip_fail, 88 'cast_test_12_multi': fail,
93 'cast_test_12_multi': skip_fail, 89 'cast_test_13_multi': fail,
94 'cast_test_13_multi': skip_fail, 90 'cast_test_14_multi': fail,
95 'cast_test_14_multi': skip_fail, 91 'cast_test_15_multi': fail,
96 'cast_test_15_multi': skip_fail, 92 'classes_static_method_clash_test': fail,
97 'cha_deopt1_test': skip_fail, 93 'code_after_try_is_executed_test_01_multi': fail,
98 'cha_deopt2_test': skip_fail, 94 'compile_time_constant10_test_none_multi': fail,
99 'cha_deopt3_test': skip_fail, 95 'compile_time_constant_a_test': fail,
100 'class_syntax2_test': skip_fail, 96 'compile_time_constant_b_test': fail,
101 'classes_static_method_clash_test': skip_fail, 97 'compile_time_constant_d_test': fail,
102 'closure_call_wrong_argument_count_negative_test': skip_fail, 98 'compile_time_constant_k_test_none_multi': fail,
103 'closure_in_constructor_test': skip_fail, 99 'compile_time_constant_o_test_none_multi': fail,
104 'closures_initializer_test': skip_fail, 100 'const_evaluation_test_01_multi': fail,
105 'code_after_try_is_executed_test_01_multi': skip_fail, 101 'const_switch_test_02_multi': fail,
106 'compile_time_constant10_test_none_multi': skip_fail, 102 'const_switch_test_04_multi': fail,
107 'compile_time_constant_a_test': skip_fail, 103 'constructor12_test': fail,
108 'compile_time_constant_b_test': skip_fail, 104 'cyclic_type2_test': fail,
109 'compile_time_constant_d_test': skip_fail, 105 'cyclic_type_test_00_multi': fail,
110 'compile_time_constant_i_test': skip_fail, 106 'cyclic_type_test_01_multi': fail,
111 'compile_time_constant_k_test_none_multi': skip_fail, 107 'cyclic_type_test_02_multi': fail,
112 'compile_time_constant_o_test_none_multi': skip_fail, 108 'cyclic_type_test_03_multi': fail,
113 'const_constructor3_test_03_multi': skip_fail, 109 'cyclic_type_test_04_multi': fail,
114 'const_escape_frog_test': skip_fail,
115 'const_evaluation_test_01_multi': skip_fail,
116 'const_switch_test_02_multi': skip_fail,
117 'const_switch_test_04_multi': skip_fail,
118 'constructor11_test': skip_fail,
119 'constructor12_test': skip_fail,
120 'custom_await_stack_trace_test': skip_fail,
121 'cyclic_type2_test': skip_fail,
122 'cyclic_type_test_00_multi': skip_fail,
123 'cyclic_type_test_01_multi': skip_fail,
124 'cyclic_type_test_02_multi': skip_fail,
125 'cyclic_type_test_03_multi': skip_fail,
126 'cyclic_type_test_04_multi': skip_fail,
127 'cyclic_type_variable_test_none_multi': skip_fail,
128 110
129 // Deferred libraries are not actually deferred. These tests all test 111 // Deferred libraries are not actually deferred. These tests all test
130 // that synchronous access to the library fails. 112 // that synchronous access to the library fails.
131 'deferred_call_empty_before_load_test': skip_fail, 113 'deferred_call_empty_before_load_test': fail,
132 'deferred_not_loaded_check_test': skip_fail, 114 'deferred_not_loaded_check_test': fail,
133 'deferred_redirecting_factory_test': skip_fail, 115 'deferred_redirecting_factory_test': fail,
134 'deferred_static_seperate_test': skip_fail, 116 'deferred_static_seperate_test': fail,
135 117
136 'deferred_regression_22995_test': skip_fail, // Strong mode "is" rejects s ome type tests. 118 'deferred_regression_22995_test': fail, // Strong mode "is" rejects some t ype tests.
137 'double_int_to_string_test': skip_fail, 119 'double_int_to_string_test': fail,
138 'double_to_string_test': skip_fail, 120 'dynamic_test': fail,
139 'dynamic_test': skip_fail,
140 'enum_mirror_test': skip_fail,
141 'exception_test': fail, 121 'exception_test': fail,
142 'execute_finally6_test': skip_fail, 122 'execute_finally6_test': fail,
143 'expect_test': skip_fail, 123 'expect_test': fail,
144 'extends_test_lib': skip_fail, 124 'extends_test_lib': fail,
145 'external_test_10_multi': skip_fail, 125 'external_test_10_multi': fail,
146 'external_test_13_multi': skip_fail, 126 'external_test_13_multi': fail,
147 'external_test_20_multi': skip_fail, 127 'external_test_20_multi': fail,
148 'f_bounded_quantification3_test': skip_fail, 128 'f_bounded_quantification3_test': fail,
149 'factory_type_parameter_test': skip_fail, 129 'fast_method_extraction_test': fail,
150 'fast_method_extraction_test': skip_fail,
151 'field_increment_bailout_test': fail, 130 'field_increment_bailout_test': fail,
152 'field_optimization3_test': skip_fail, 131 'field_optimization3_test': fail,
153 'final_syntax_test_08_multi': skip_fail, 132 'final_syntax_test_08_multi': fail,
154 'first_class_types_test': skip_fail, 133 'first_class_types_test': fail,
155 'flatten_test_01_multi': skip_fail, 134 'for_variable_capture_test': chrome_fail,
156 'flatten_test_04_multi': skip_fail, 135 'function_subtype0_test': fail,
157 'for_in2_test': skip_fail, 136 'function_subtype1_test': fail,
158 'for_variable_capture_test': skip_fail, 137 'function_subtype2_test': fail,
159 'function_subtype0_test': skip_fail, 138 'function_subtype3_test': fail,
160 'function_subtype1_test': skip_fail, 139 'function_subtype_bound_closure0_test': fail,
161 'function_subtype2_test': skip_fail, 140 'function_subtype_bound_closure1_test': fail,
162 'function_subtype3_test': skip_fail, 141 'function_subtype_bound_closure2_test': fail,
163 'function_subtype_bound_closure0_test': skip_fail, 142 'function_subtype_bound_closure3_test': fail,
164 'function_subtype_bound_closure1_test': skip_fail, 143 'function_subtype_bound_closure4_test': fail,
165 'function_subtype_bound_closure2_test': skip_fail, 144 'function_subtype_bound_closure5_test': fail,
166 'function_subtype_bound_closure3_test': skip_fail, 145 'function_subtype_bound_closure5a_test': fail,
167 'function_subtype_bound_closure4_test': skip_fail, 146 'function_subtype_bound_closure6_test': fail,
168 'function_subtype_bound_closure5_test': skip_fail,
169 'function_subtype_bound_closure5a_test': skip_fail,
170 'function_subtype_bound_closure6_test': skip_fail,
171 'function_subtype_call0_test': fail, // Strong mode "is" rejects some type tests. 147 'function_subtype_call0_test': fail, // Strong mode "is" rejects some type tests.
172 'function_subtype_call1_test': fail, 148 'function_subtype_call1_test': fail,
173 'function_subtype_call2_test': fail, 149 'function_subtype_call2_test': fail,
174 'function_subtype_cast0_test': fail, 150 'function_subtype_cast0_test': fail,
175 'function_subtype_cast1_test': fail, 151 'function_subtype_cast1_test': fail,
176 'function_subtype_cast2_test': fail, 152 'function_subtype_cast2_test': fail,
177 'function_subtype_cast3_test': fail, 153 'function_subtype_cast3_test': fail,
178 'function_subtype_factory0_test': skip_fail, 154 'function_subtype_factory0_test': fail,
179 'function_subtype_inline0_test': skip_fail, 155 'function_subtype_inline0_test': fail,
180 'function_subtype_local0_test': skip_fail, 156 'function_subtype_local0_test': fail,
181 'function_subtype_local1_test': skip_fail, 157 'function_subtype_local1_test': fail,
182 'function_subtype_local2_test': skip_fail, 158 'function_subtype_local2_test': fail,
183 'function_subtype_local3_test': skip_fail, 159 'function_subtype_local3_test': fail,
184 'function_subtype_local4_test': skip_fail, 160 'function_subtype_local4_test': fail,
185 'function_subtype_local5_test': skip_fail, 161 'function_subtype_local5_test': fail,
186 'function_subtype_named1_test': skip_fail, 162 'function_subtype_named1_test': fail,
187 'function_subtype_named2_test': skip_fail, 163 'function_subtype_named2_test': fail,
188 'function_subtype_not0_test': skip_fail, 164 'function_subtype_not0_test': fail,
189 'function_subtype_not1_test': skip_fail, 165 'function_subtype_not1_test': fail,
190 'function_subtype_not2_test': skip_fail, 166 'function_subtype_not2_test': fail,
191 'function_subtype_not3_test': skip_fail, 167 'function_subtype_not3_test': fail,
192 'function_subtype_optional1_test': skip_fail, 168 'function_subtype_optional1_test': fail,
193 'function_subtype_optional2_test': skip_fail, 169 'function_subtype_optional2_test': fail,
194 'function_subtype_top_level0_test': skip_fail, 170 'function_subtype_top_level0_test': fail,
195 'function_subtype_top_level1_test': skip_fail, 171 'function_subtype_top_level1_test': fail,
196 'function_subtype_typearg0_test': skip_fail, 172 'function_subtype_typearg2_test': fail,
197 'function_subtype_typearg2_test': skip_fail, 173 'function_subtype_typearg4_test': fail,
198 'function_subtype_typearg4_test': skip_fail, 174 'function_type_alias2_test': fail,
199 'function_type_alias2_test': skip_fail, 175 'function_type_alias3_test': fail,
200 'function_type_alias3_test': skip_fail, 176 'function_type_alias4_test': fail,
201 'function_type_alias4_test': skip_fail, 177 'function_type_alias6_test_none_multi': fail,
202 'function_type_alias6_test_none_multi': skip_fail,
203 'gc_test': skip_fail,
204 'generic_field_mixin2_test': skip_fail,
205 'generic_field_mixin3_test': skip_fail,
206 'generic_field_mixin4_test': skip_fail,
207 'generic_field_mixin5_test': skip_fail,
208 'generic_field_mixin_test': skip_fail,
209 'generic_instanceof_test': fail, // runtime strong mode reject 178 'generic_instanceof_test': fail, // runtime strong mode reject
210 'generic_instanceof2_test': skip_fail, 179 'generic_instanceof2_test': fail,
211 'generic_is_check_test': skip_fail, 180 'generic_is_check_test': fail,
212 'getter_closure_execution_order_test': skip_fail, 181 'getter_closure_execution_order_test': fail,
213 'hash_code_mangling_test': skip_fail, 182 'hash_code_mangling_test': fail,
214 'identical_closure2_test': skip_fail, 183 'identical_closure2_test': fail,
215 'infinite_switch_label_test': skip_fail, 184 'infinite_switch_label_test': fail,
216 'infinity_test': skip_fail, 185 'infinity_test': fail,
217 'initializing_formal_final_test': skip_fail, 186 'initializing_formal_final_test': fail,
218 'instance_creation_in_function_annotation_test': skip_fail, 187 'instance_creation_in_function_annotation_test': fail,
219 'instanceof2_test': fail, 188 'instanceof2_test': fail,
220 'instanceof4_test_01_multi': fail, 189 'instanceof4_test_01_multi': fail,
221 'instanceof4_test_none_multi': fail, 190 'instanceof4_test_none_multi': fail,
222 'instanceof_optimized_test': skip_fail, 191 'instanceof_optimized_test': fail,
223 'integer_division_by_zero_test': fail, 192 'integer_division_by_zero_test': fail,
224 'is_nan_test': fail, 193 'is_nan_test': fail,
225 'issue10747_test': skip_fail, 194 'issue_22780_test_01_multi': fail,
226 'issue13179_test': skip_fail, 195 'lazy_static3_test': fail,
227 'issue21079_test': skip_fail, 196 'least_upper_bound_expansive_test_none_multi': fail,
228 'issue21957_test': skip_fail, 197 'left_shift_test': fail,
229 'issue23244_test': skip_fail, 198 'list_is_test': fail,
230 'issue_1751477_test': skip_fail, 199 'list_literal3_test': fail,
231 'issue_22780_test_01_multi': skip_fail, 200 'many_generic_instanceof_test': fail,
232 'issue_23914_test': skip_fail, 201 'map_literal10_test': fail,
233 'js_properties_test': skip_fail, 202 'map_literal7_test': fail,
234 'lazy_static3_test': skip_fail, 203 'method_invocation_test': fail,
235 'least_upper_bound_expansive_test_none_multi': skip_fail, 204 'mint_arithmetic_test': fail,
236 'left_shift_test': skip_fail, 205 'mixin_forwarding_constructor3_test': fail,
237 'list_is_test': skip_fail, 206 'mixin_implements_test': fail,
238 'list_literal3_test': skip_fail, 207 'mixin_issue10216_2_test': fail,
239 'many_generic_instanceof_test': skip_fail, 208 'mixin_mixin2_test': fail,
240 'map_literal10_test': skip_fail, 209 'mixin_mixin3_test': fail,
241 'map_literal7_test': skip_fail, 210 'mixin_mixin4_test': fail,
242 'memory_swap_test': skip_fail, 211 'mixin_mixin5_test': fail,
243 'method_invocation_test': skip_fail, 212 'mixin_mixin6_test': fail,
244 'mint_arithmetic_test': skip_fail, 213 'mixin_mixin7_test': fail,
245 'mixin_forwarding_constructor3_test': skip_fail, 214 'mixin_mixin_bound2_test': fail,
246 'mixin_generic_test': skip_fail, 215 'mixin_mixin_bound_test': fail,
247 'mixin_implements_test': skip_fail, 216 'mixin_mixin_test': fail,
248 'mixin_invalid_inheritance1_test_none_multi': skip_fail, 217 'mixin_regress_13688_test': fail,
249 'mixin_issue10216_2_test': skip_fail,
250 'mixin_mixin2_test': skip_fail,
251 'mixin_mixin3_test': skip_fail,
252 'mixin_mixin4_test': skip_fail,
253 'mixin_mixin5_test': skip_fail,
254 'mixin_mixin6_test': skip_fail,
255 'mixin_mixin7_test': skip_fail,
256 'mixin_mixin_bound2_test': skip_fail,
257 'mixin_mixin_bound_test': skip_fail,
258 'mixin_mixin_test': skip_fail,
259 'mixin_regress_13688_test': skip_fail,
260 'mixin_type_parameter1_test': skip_fail,
261 'mixin_type_parameter2_test': skip_fail,
262 'mixin_type_parameter3_test': skip_fail,
263 'modulo_test': fail, 218 'modulo_test': fail,
264 'named_parameter_clash_test': skip_fail, 219 'named_parameter_clash_test': fail,
265 'named_parameters_passing_falsy_test': firefox_fail, 220 'named_parameters_passing_falsy_test': firefox_fail,
266 'nan_identical_test': skip_fail, 221 'nan_identical_test': fail,
267 'nested_switch_label_test': skip_fail, 222 'nested_switch_label_test': fail,
268 'number_identifier_test_05_multi': skip_fail, 223 'number_identifier_test_05_multi': fail,
269 'number_identity2_test': skip_fail, 224 'number_identity2_test': fail,
270 'numbers_test': skip_fail, 225 'numbers_test': fail,
271 'optimized_hoisting_checked_mode_assert_test': skip_fail, 226 'redirecting_factory_reflection_test': fail,
272 'redirecting_factory_reflection_test': skip_fail, 227 'regress_16640_test': fail,
273 'regress_13462_0_test': skip_fail,
274 'regress_13462_1_test': skip_fail,
275 'regress_14105_test': skip_fail,
276 'regress_16640_test': skip_fail,
277 'regress_18535_test': fail, 228 'regress_18535_test': fail,
278 'regress_21795_test': skip_fail, 229 'regress_22666_test': fail,
279 'regress_22443_test': skip_fail, 230 'regress_22777_test': fail,
280 'regress_22666_test': skip_fail, 231 'setter_no_getter_test_01_multi': fail,
281 'setter_no_getter_test_01_multi': skip_fail, 232 'stack_overflow_stacktrace_test': fail,
282 'stack_overflow_stacktrace_test': skip_fail, 233 'stack_overflow_test': fail,
283 'stack_overflow_test': skip_fail, 234 'stacktrace_rethrow_error_test_none_multi': fail,
284 'stacktrace_rethrow_error_test_none_multi': skip_fail, 235 'stacktrace_rethrow_error_test_withtraceparameter_multi': fail,
285 'stacktrace_rethrow_error_test_withtraceparameter_multi': skip_fail, 236 'stacktrace_test': chrome_fail,
286 'stacktrace_test': skip_fail, 237 'string_interpolate_null_test': fail,
287 'string_interpolate_null_test': skip_fail, 238 'switch_label2_test': fail,
288 'super_operator_index3_test': skip_fail, 239 'switch_label_test': fail,
289 'super_operator_index4_test': skip_fail, 240 'switch_try_catch_test': fail,
290 'switch_label2_test': skip_fail, 241 'throwing_lazy_variable_test': fail,
291 'switch_label_test': skip_fail,
292 'switch_try_catch_test': skip_fail,
293 'sync_generator1_test_none_multi': skip_fail,
294 'throwing_lazy_variable_test': skip_fail,
295 'top_level_non_prefixed_library_test': skip_fail,
296 'truncdiv_test': fail, // did not throw 242 'truncdiv_test': fail, // did not throw
297 'type_variable_nested_test': skip_fail, // unsound is-check 243 'type_variable_nested_test': fail, // unsound is-check
298 'type_variable_typedef_test': skip_fail, // unsound is-check 244 'type_variable_typedef_test': fail, // unsound is-check
299 245
300 'bit_operations_test_01_multi': skip_fail, 246 'bit_operations_test_01_multi': fail,
301 'bit_operations_test_02_multi': skip_fail, 247 'bit_operations_test_02_multi': fail,
302 'bit_operations_test_03_multi': skip_fail, 248 'bit_operations_test_03_multi': fail,
303 'bit_operations_test_04_multi': skip_fail, 249 'bit_operations_test_04_multi': fail,
304 'bool_condition_check_test_01_multi': skip_fail, 250 'bool_condition_check_test_01_multi': fail,
305 'deferred_constraints_constants_test_none_multi': skip_fail, 251 'deferred_load_constants_test_none_multi': fail,
306 'deferred_constraints_constants_test_reference_after_load_multi': skip_fai l, 252 'external_test_21_multi': fail,
307 'deferred_constraints_type_annotation_test_new_generic1_multi': skip_fail, 253 'external_test_24_multi': fail,
308 'deferred_constraints_type_annotation_test_new_multi': skip_fail, 254 'main_not_a_function_test_01_multi': fail,
309 'deferred_constraints_type_annotation_test_none_multi': skip_fail, 255 'multiline_newline_test_04_multi': fail,
310 'deferred_constraints_type_annotation_test_static_method_multi': skip_fail , 256 'multiline_newline_test_05_multi': fail,
311 'deferred_constraints_type_annotation_test_type_annotation_non_deferred_mu lti': skip_fail, 257 'multiline_newline_test_06_multi': fail,
312 'deferred_load_constants_test_none_multi': skip_fail, 258 'multiline_newline_test_none_multi': fail,
313 'deferred_load_library_wrong_args_test_01_multi': skip_fail, 259 'no_main_test_01_multi': fail,
314 'deferred_load_library_wrong_args_test_none_multi': skip_fail,
315 'external_test_21_multi': skip_fail,
316 'external_test_24_multi': skip_fail,
317 'main_not_a_function_test_01_multi': skip_fail,
318 'multiline_newline_test_04_multi': skip_fail,
319 'multiline_newline_test_05_multi': skip_fail,
320 'multiline_newline_test_06_multi': skip_fail,
321 'multiline_newline_test_none_multi': skip_fail,
322 'no_main_test_01_multi': skip_fail,
323 260
324 // https://github.com/dart-lang/sdk/issues/26123 261 // https://github.com/dart-lang/sdk/issues/26123
325 'bad_raw_string_negative_test': skip_fail, 262 'bad_raw_string_negative_test': fail,
326 263
327 // https://github.com/dart-lang/sdk/issues/26124 264 // https://github.com/dart-lang/sdk/issues/26124
328 'prefix10_negative_test': skip_fail, 265 'prefix10_negative_test': fail,
329 266
330 'library_prefixes_test1': 'helper', 267 'library_prefixes_test1': 'helper',
331 'library_prefixes_test2': 'helper', 268 'library_prefixes_test2': 'helper',
332 'top_level_prefixed_library_test': 'helper', 269 'top_level_prefixed_library_test': 'helper',
333 270
334 }, 271 },
335 272
336 'corelib': { 273 'corelib': {
337 'apply2_test': fail, 274 'apply2_test': fail,
338 'apply3_test': fail, 275 'apply3_test': fail,
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 'constructor_calls_created_synchronously_test': async_unittest, 488 'constructor_calls_created_synchronously_test': async_unittest,
552 'created_callback_test': async_unittest, 489 'created_callback_test': async_unittest,
553 'entered_left_view_test': async_unittest, 490 'entered_left_view_test': async_unittest,
554 'js_custom_test': async_unittest, 491 'js_custom_test': async_unittest,
555 'mirrors_test': async_unittest, 492 'mirrors_test': async_unittest,
556 'regress_194523002_test': async_unittest, 493 'regress_194523002_test': async_unittest,
557 }, 494 },
558 495
559 'lib/math': { 496 'lib/math': {
560 // TODO(het): triage 497 // TODO(het): triage
561 'double_pow_test': skip_fail, 498 'double_pow_test': fail,
562 'low_test': skip_fail, 499 'low_test': fail,
563 'math_test': skip_fail,
564 'math2_test': skip_fail,
565 'pi_test': skip_timeout, 500 'pi_test': skip_timeout,
566 'random_big_test': skip_fail, 501 'random_big_test': fail,
567 }, 502 },
568 503
569 'lib/typed_data': { 504 'lib/typed_data': {
570 // No bigint or int64 support 505 // No bigint or int64 support
571 'int32x4_bigint_test': skip_fail, 506 'int32x4_bigint_test': fail,
572 'int64_list_load_store_test': skip_fail, 507 'int64_list_load_store_test': fail,
573 'typed_data_hierarchy_int64_test': skip_fail, 508 'typed_data_hierarchy_int64_test': fail,
574 'typed_data_list_test': fail, 509 'typed_data_list_test': fail,
575 }, 510 },
576 511
577 'lib/mirrors': { 512 'lib/mirrors': {
578 'abstract_class_test_none_multi': fail, 513 'abstract_class_test_none_multi': fail,
579 'accessor_cache_overflow_test': fail, 514 'accessor_cache_overflow_test': fail,
580 'array_tracing3_test': fail, 515 'array_tracing3_test': fail,
581 'array_tracing_test': fail, 516 'array_tracing_test': fail,
582 'basic_types_in_dart_core_test': fail, 517 'basic_types_in_dart_core_test': fail,
583 'circular_factory_redirection_test_none_multi': fail, 518 'circular_factory_redirection_test_none_multi': fail,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 'reflected_type_special_types_test': fail, 622 'reflected_type_special_types_test': fail,
688 'reflected_type_test_none_multi': fail, 623 'reflected_type_test_none_multi': fail,
689 'reflected_type_typedefs_test': fail, 624 'reflected_type_typedefs_test': fail,
690 'reflected_type_typevars_test': fail, 625 'reflected_type_typevars_test': fail,
691 'reflectively_instantiate_uninstantiated_class_test': fail, 626 'reflectively_instantiate_uninstantiated_class_test': fail,
692 'regress_14304_test': fail, 627 'regress_14304_test': fail,
693 'regress_26187_test': fail, 628 'regress_26187_test': fail,
694 'relation_assignable_test': fail, 629 'relation_assignable_test': fail,
695 'relation_subtype_test': fail, 630 'relation_subtype_test': fail,
696 'set_field_with_final_test': fail, 631 'set_field_with_final_test': fail,
697 'spawn_function_root_library_test': skip_fail,
698 'symbol_validation_test_01_multi': fail, 632 'symbol_validation_test_01_multi': fail,
699 'symbol_validation_test_none_multi': fail, 633 'symbol_validation_test_none_multi': fail,
700 'to_string_test': fail, 634 'to_string_test': fail,
701 'type_argument_is_type_variable_test': fail, 635 'type_argument_is_type_variable_test': fail,
702 'type_variable_is_static_test': fail, 636 'type_variable_is_static_test': fail,
703 'type_variable_owner_test_01_multi': fail, 637 'type_variable_owner_test_01_multi': fail,
704 'type_variable_owner_test_none_multi': fail, 638 'type_variable_owner_test_none_multi': fail,
705 'typedef_deferred_library_test': skip_fail, // Isolate spawn not support 639 'typedef_deferred_library_test': fail, // Isolate spawn not support
706 'typedef_library_test': fail, 640 'typedef_library_test': fail,
707 'typedef_metadata_test': fail, 641 'typedef_metadata_test': fail,
708 'typedef_test': fail, 642 'typedef_test': fail,
709 'typevariable_mirror_metadata_test': fail, 643 'typevariable_mirror_metadata_test': fail,
710 'unnamed_library_test': fail, 644 'unnamed_library_test': fail,
711 'variable_is_const_test_none_multi': fail, 645 'variable_is_const_test_none_multi': fail,
712 }, 646 },
713 }; 647 };
714 648
715 function countMatches(text, regex) { 649 function countMatches(text, regex) {
716 let matches = text.match(regex); 650 let matches = text.match(regex);
717 return matches ? matches.length : 0; 651 return matches ? matches.length : 0;
718 } 652 }
719 function libraryName(name) { 653 function libraryName(name) {
720 return name.replace(/-/g, '$45'); 654 return name.replace(/-/g, '$45');
721 } 655 }
722 656
723 let unittest_tests = []; 657 let unittest_tests = [];
658 let unittestAccidentallyInitialized = false;
724 659
725 let languageTestPattern = 660 let languageTestPattern =
726 new RegExp('gen/codegen_output/(.*)/([^/]*_test[^/]*)'); 661 new RegExp('gen/codegen_output/(.*)/([^/]*_test[^/]*)');
727 // We need to let Dart unittest control when tests are run not mocha. 662 // We need to let Dart unittest control when tests are run not mocha.
728 // mocha.allowUncaught(true); 663 // mocha.allowUncaught(true);
729 for (let testFile of allTestFiles) { 664 for (let testFile of allTestFiles) {
730 let match = languageTestPattern.exec(testFile); 665 let match = languageTestPattern.exec(testFile);
731 if (match != null) { 666 if (match != null) {
732 let status_group = match[1]; 667 let status_group = match[1];
733 let name = match[2]; 668 let name = match[2];
(...skipping 25 matching lines...) Expand all
759 if (has('unittest')) { 694 if (has('unittest')) {
760 unittest_tests.push(() => { 695 unittest_tests.push(() => {
761 console.log('Running unittest test ' + testFile); 696 console.log('Running unittest test ' + testFile);
762 require(module)[libraryName(name)].main(); 697 require(module)[libraryName(name)].main();
763 }); 698 });
764 continue; 699 continue;
765 } 700 }
766 701
767 let protect = (f) => { // Returns the exception, or `null`. 702 let protect = (f) => { // Returns the exception, or `null`.
768 try { 703 try {
769 f(); 704 return f();
770 return null;
771 } catch (e) { 705 } catch (e) {
772 return e; 706 return e;
773 } 707 }
774 }; 708 };
775 709
776 test(name, function(done) { // 'function' to allow `this.timeout`. 710 test(name, function(done) { // 'function' to allow `this.timeout`.
777 async_helper.asyncTestInitialize(done);
778 console.debug('Running test: ' + name); 711 console.debug('Running test: ' + name);
779 712
780 var result = null; 713 // Many tests are async. Currently, tests can indicate this in
714 // two different ways. First, `main` can call (in Dart)
715 // `async_helper.asyncStart`. We can check if this happened by
716 // querying `async_helper.asyncTestStarted` afterward and waiting for
717 // the callback if so. Second, `main` can return a `Future`. If so,
718 // we wait for that the complete. If neither is true, we assume the
Bob Nystrom 2017/01/13 02:19:53 "that the complete" -> "that to complete".
719 // test is synchronous.
720 //
721 // A 'failing' test will throw an exception. This exception may be
722 // synchronous (i.e., during `main`) or asynchronous (after `main` in
723 // lieu of the callback/future). The latter exceptions are not
724 // directly caught. Instead, we intercept `window.onerror` to detect
725 // them.
726 //
727 // Note, if the test is marked 'negative' or 'fail', than pass and fail
728 // are effectively inverted: only a success is reported.
729 //
730 // In all cases, we funnel test completion through the `finish` handler
731 // below to handle reporting (based on status) and cleanup state.
732 //
733 // A test can finish in one of several ways:
734 // 1. Synchronous without an error. In this case, `main` returns
735 // null and did not set `async_helper`. `finish` is invoked
736 // immediately.
737 // 2. Synchronous error. `main` throws an error. `finish`
738 // is invoked immediately with the error.
739 // 3. `Future` without an error. In this case, the future completes
740 // and asynchronously invokes `finish`.
741 // 4. Via `async_helper` without an error. In this case, the
742 // `async_helper` library triggers `finish` via its callback.
743 // 5. Asynchronously with an error. In this case, `window.onerror`
744 // triggers `finish` with the error.
745 // 6. Hangs. In this case, we rely on the underlying mocha framework
746 // timeout.
747 //
748 // TODO(vsm): This currently doesn't handle tests that trigger multiple
749 // asynchronous exceptions.
750
781 let mainLibrary = require(module)[libraryName(name)]; 751 let mainLibrary = require(module)[libraryName(name)];
782 let negative = /negative_test/.test(name); 752 let negative = /negative_test/.test(name);
783 if (has('slow')) this.timeout(10000); 753 let fail = has('fail');
784 if (has('fail')) { 754
785 let e = protect(mainLibrary.main); 755 function finish(error) {
786 if (negative) { 756 // If the test left any lingering detritus in the DOM, blow it away
787 if (e != null) { 757 // so it doesn't interfere with later tests.
788 throw new Error( 758 if (fail) {
759 if (negative) {
760 if (error) {
761 error = new Error(
789 "negative test marked as 'fail' " + 762 "negative test marked as 'fail' " +
790 "but passed by throwing:\n" + e); 763 "but passed by throwing:\n" + error);
764 }
765 } else if (error) {
766 error = null
767 } else {
768 error = new Error("test marked as 'fail' but passed");
791 } 769 }
792 } else { 770 } else if (negative) {
793 if (e == null) { 771 if (!error) {
794 throw new Error("test marked as 'fail' but passed"); 772 error = new Error("test marked as 'negative' but did not throw");
773 } else {
774 error = null;
795 } 775 }
796 } 776 }
797 } else { 777 minitest.finishTests();
798 try { 778 document.body.innerHTML = '';
799 if (negative) { 779 console.log("cleared");
800 assert.throws(mainLibrary.main); 780 if (error && !(error instanceof Error)) error = new Error(error);
801 } else { 781 done(error);
802 result = mainLibrary.main();
803 }
804 } finally {
805 minitest.finishTests();
806 }
807 } 782 }
808 783
809 // If the test left any lingering detritus in the DOM, blow it away 784 // Intercept uncaught exceptions
810 // so it doesn't interfere with later tests. 785 window.onerror = function(message, url, line, column, error) {
811 document.body.innerHTML = ''; 786 console.warn('Asynchronous error in ' + name + ': ' + message);
812 console.log("cleared"); 787 if (!error) {
788 error = new Error(message);
789 }
790 finish(error);
791 };
813 792
814 if (!async_helper.asyncTestStarted) { 793 async_helper.asyncTestInitialize(finish);
794 if (has('slow')) this.timeout(10000);
795
796 var result;
797 try {
798 var result = mainLibrary.main();
799 if (result && !(result instanceof dart_sdk.async.Future)) {
800 result = null;
801 }
802 } catch (e) {
803 finish(e);
804 }
805
806 // Ensure this isn't a unittest
807 if (!unittestAccidentallyInitialized &&
808 unittest.src__test_environment.environment.initialized) {
809 // This suppresses duplicate messages for later tests
810 unittestAccidentallyInitialized = true;
811 finish(new Error('Test ' + name + ' must be marked as a unittest'));
812 } else if (!async_helper.asyncTestStarted) {
815 if (!result) { 813 if (!result) {
816 done(); 814 finish();
817 } else { 815 } else {
818 result.then(dart_sdk.dart.dynamic)(() => done()); 816 result.then(dart_sdk.dart.dynamic)(() => finish());
819 } 817 }
820 } 818 }
821 }); 819 });
822 } 820 }
823 } 821 }
824 822
825 let mochaOnError;
826 // We run these tests in a mocha test wrapper to avoid the confusing failure 823 // We run these tests in a mocha test wrapper to avoid the confusing failure
827 // case of dart unittests being interleaved with mocha tests. 824 // case of dart unittests being interleaved with mocha tests.
828 // In practice we are really just suppressing all mocha test behavior while 825 // In practice we are really just suppressing all mocha test behavior while
829 // Dart unittests run and then re-enabling it when the dart tests complete. 826 // Dart unittests run and then re-enabling it when the dart tests complete.
830 html_config.useHtmlConfiguration(); 827 html_config.useHtmlConfiguration();
831 test('run all dart unittests', function(done) { // 'function' to allow `this.t imeout` 828 test('run all dart unittests', function(done) { // 'function' to allow `this.t imeout`
832 if (unittest_tests.length == 0) return done(); 829 if (unittest_tests.length == 0) return done();
833 830
834 // TODO(vsm): We're using an old deprecated version of unittest. 831 // TODO(vsm): We're using an old deprecated version of unittest.
835 // We need to migrate all tests (in the SDK itself) off of 832 // We need to migrate all tests (in the SDK itself) off of
836 // unittest. 833 // unittest.
837 834
838 // All unittests need to be explicitly marked as such above. If 835 // All unittests need to be explicitly marked as such above. If
839 // not, the unittest framework will be run in a 'normal' test and 836 // not, the unittest framework will be run in a 'normal' test and
840 // left in an inconsistent state at this point triggering spurious 837 // left in an inconsistent state at this point triggering spurious
841 // failures. This check ensures we're not in such a state. If it fails, 838 // failures. This check ensures we're not in such a state. If it fails,
842 // we've likely added a new unittest and need to categorize it as such. 839 // we've likely added a new unittest and need to categorize it as such.
843 if (unittest.src__test_environment.environment.testCases[dart_sdk.dartx.leng th] != 0) { 840 if (unittest.src__test_environment.environment.testCases[dart_sdk.dartx.leng th] != 0) {
844 return done(new Error('Unittest framework in an invalid state')); 841 return done(new Error('Unittest framework in an invalid state'));
845 } 842 }
846 843
847 this.timeout(100000000); 844 this.timeout(100000000);
848 this.enableTimeouts(false); 845 this.enableTimeouts(false);
849 // Suppress mocha on-error handling because it will mess up unittests. 846 // Suppress mocha on-error handling because it will mess up unittests.
850 mochaOnError = window.onerror;
851 window.onerror = function(err, url, line) { 847 window.onerror = function(err, url, line) {
852 console.error(err, url, line); 848 console.error(err, url, line);
853 }; 849 };
854 window.addEventListener('message', (event) => { 850 window.addEventListener('message', (event) => {
855 if (event.data == 'unittest-suite-done') { 851 if (event.data == 'unittest-suite-done') {
856 window.console.log("Done running unittests"); 852 window.console.log("Done running unittests");
857 let output = document.body.textContent; 853 let output = document.body.textContent;
858 // Restore the Mocha onerror handler in case future tests need to run. 854 // Restore the Mocha onerror handler in case future tests need to run.
859 window.onerror = mochaOnError; 855 window.onerror = mochaOnError;
860 this.enableTimeouts(true); 856 this.enableTimeouts(true);
(...skipping 17 matching lines...) Expand all
878 874
879 for (let action of unittest_tests) { 875 for (let action of unittest_tests) {
880 try { 876 try {
881 action(); 877 action();
882 } catch (e) { 878 } catch (e) {
883 console.error("Caught error tying to setup test:", e); 879 console.error("Caught error tying to setup test:", e);
884 } 880 }
885 } 881 }
886 }); 882 });
887 }); 883 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698