| 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 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; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 'compile_time_constant_i_test': skip_fail, | 110 'compile_time_constant_i_test': skip_fail, |
| 111 'compile_time_constant_k_test_none_multi': skip_fail, | 111 'compile_time_constant_k_test_none_multi': skip_fail, |
| 112 'compile_time_constant_o_test_none_multi': skip_fail, | 112 'compile_time_constant_o_test_none_multi': skip_fail, |
| 113 'const_constructor3_test_03_multi': skip_fail, | 113 'const_constructor3_test_03_multi': skip_fail, |
| 114 'const_escape_frog_test': skip_fail, | 114 'const_escape_frog_test': skip_fail, |
| 115 'const_evaluation_test_01_multi': skip_fail, | 115 'const_evaluation_test_01_multi': skip_fail, |
| 116 'const_switch_test_02_multi': skip_fail, | 116 'const_switch_test_02_multi': skip_fail, |
| 117 'const_switch_test_04_multi': skip_fail, | 117 'const_switch_test_04_multi': skip_fail, |
| 118 'constructor11_test': skip_fail, | 118 'constructor11_test': skip_fail, |
| 119 'constructor12_test': skip_fail, | 119 'constructor12_test': skip_fail, |
| 120 'custom_await_stack_trace_test': skip_fail, |
| 120 'cyclic_type2_test': skip_fail, | 121 'cyclic_type2_test': skip_fail, |
| 121 'cyclic_type_test_00_multi': skip_fail, | 122 'cyclic_type_test_00_multi': skip_fail, |
| 122 'cyclic_type_test_01_multi': skip_fail, | 123 'cyclic_type_test_01_multi': skip_fail, |
| 123 'cyclic_type_test_02_multi': skip_fail, | 124 'cyclic_type_test_02_multi': skip_fail, |
| 124 'cyclic_type_test_03_multi': skip_fail, | 125 'cyclic_type_test_03_multi': skip_fail, |
| 125 'cyclic_type_test_04_multi': skip_fail, | 126 'cyclic_type_test_04_multi': skip_fail, |
| 126 'cyclic_type_variable_test_none_multi': skip_fail, | 127 'cyclic_type_variable_test_none_multi': skip_fail, |
| 127 | 128 |
| 128 // Deferred libraries are not actually deferred. These tests all test | 129 // Deferred libraries are not actually deferred. These tests all test |
| 129 // that synchronous access to the library fails. | 130 // that synchronous access to the library fails. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 144 'external_test_10_multi': skip_fail, | 145 'external_test_10_multi': skip_fail, |
| 145 'external_test_13_multi': skip_fail, | 146 'external_test_13_multi': skip_fail, |
| 146 'external_test_20_multi': skip_fail, | 147 'external_test_20_multi': skip_fail, |
| 147 'f_bounded_quantification3_test': skip_fail, | 148 'f_bounded_quantification3_test': skip_fail, |
| 148 'factory_type_parameter_test': skip_fail, | 149 'factory_type_parameter_test': skip_fail, |
| 149 'fast_method_extraction_test': skip_fail, | 150 'fast_method_extraction_test': skip_fail, |
| 150 'field_increment_bailout_test': fail, | 151 'field_increment_bailout_test': fail, |
| 151 'field_optimization3_test': skip_fail, | 152 'field_optimization3_test': skip_fail, |
| 152 'final_syntax_test_08_multi': skip_fail, | 153 'final_syntax_test_08_multi': skip_fail, |
| 153 'first_class_types_test': skip_fail, | 154 'first_class_types_test': skip_fail, |
| 155 'flatten_test_01_multi': skip_fail, |
| 156 'flatten_test_04_multi': skip_fail, |
| 154 'for_in2_test': skip_fail, | 157 'for_in2_test': skip_fail, |
| 155 'for_variable_capture_test': skip_fail, | 158 'for_variable_capture_test': skip_fail, |
| 156 'function_subtype0_test': skip_fail, | 159 'function_subtype0_test': skip_fail, |
| 157 'function_subtype1_test': skip_fail, | 160 'function_subtype1_test': skip_fail, |
| 158 'function_subtype2_test': skip_fail, | 161 'function_subtype2_test': skip_fail, |
| 159 'function_subtype3_test': skip_fail, | 162 'function_subtype3_test': skip_fail, |
| 160 'function_subtype_bound_closure0_test': skip_fail, | 163 'function_subtype_bound_closure0_test': skip_fail, |
| 161 'function_subtype_bound_closure1_test': skip_fail, | 164 'function_subtype_bound_closure1_test': skip_fail, |
| 162 'function_subtype_bound_closure2_test': skip_fail, | 165 'function_subtype_bound_closure2_test': skip_fail, |
| 163 'function_subtype_bound_closure3_test': skip_fail, | 166 'function_subtype_bound_closure3_test': skip_fail, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 'instanceof2_test': fail, | 219 'instanceof2_test': fail, |
| 217 'instanceof4_test_01_multi': fail, | 220 'instanceof4_test_01_multi': fail, |
| 218 'instanceof4_test_none_multi': fail, | 221 'instanceof4_test_none_multi': fail, |
| 219 'instanceof_optimized_test': skip_fail, | 222 'instanceof_optimized_test': skip_fail, |
| 220 'integer_division_by_zero_test': fail, | 223 'integer_division_by_zero_test': fail, |
| 221 'is_nan_test': fail, | 224 'is_nan_test': fail, |
| 222 'issue10747_test': skip_fail, | 225 'issue10747_test': skip_fail, |
| 223 'issue13179_test': skip_fail, | 226 'issue13179_test': skip_fail, |
| 224 'issue21079_test': skip_fail, | 227 'issue21079_test': skip_fail, |
| 225 'issue21957_test': skip_fail, | 228 'issue21957_test': skip_fail, |
| 229 'issue23244_test': skip_fail, |
| 226 'issue_1751477_test': skip_fail, | 230 'issue_1751477_test': skip_fail, |
| 227 'issue_22780_test_01_multi': skip_fail, | 231 'issue_22780_test_01_multi': skip_fail, |
| 228 'issue_23914_test': skip_fail, | 232 'issue_23914_test': skip_fail, |
| 229 'js_properties_test': skip_fail, | 233 'js_properties_test': skip_fail, |
| 230 'lazy_static3_test': skip_fail, | 234 'lazy_static3_test': skip_fail, |
| 231 'least_upper_bound_expansive_test_none_multi': skip_fail, | 235 'least_upper_bound_expansive_test_none_multi': skip_fail, |
| 232 'left_shift_test': skip_fail, | 236 'left_shift_test': skip_fail, |
| 233 'list_is_test': skip_fail, | 237 'list_is_test': skip_fail, |
| 234 'list_literal3_test': skip_fail, | 238 'list_literal3_test': skip_fail, |
| 235 'many_generic_instanceof_test': skip_fail, | 239 'many_generic_instanceof_test': skip_fail, |
| 236 'map_literal10_test': skip_fail, | 240 'map_literal10_test': skip_fail, |
| 237 'map_literal7_test': skip_fail, | 241 'map_literal7_test': skip_fail, |
| 238 'memory_swap_test': skip_fail, | 242 'memory_swap_test': skip_fail, |
| 239 'method_invocation_test': skip_fail, | 243 'method_invocation_test': skip_fail, |
| 240 'mint_arithmetic_test': skip_fail, | 244 'mint_arithmetic_test': skip_fail, |
| 241 'mixin_forwarding_constructor3_test': skip_fail, | 245 'mixin_forwarding_constructor3_test': skip_fail, |
| 242 'mixin_generic_test': skip_fail, | 246 'mixin_generic_test': skip_fail, |
| 243 'mixin_implements_test': skip_fail, | 247 'mixin_implements_test': skip_fail, |
| 248 'mixin_invalid_inheritance1_test_none_multi': skip_fail, |
| 244 'mixin_issue10216_2_test': skip_fail, | 249 'mixin_issue10216_2_test': skip_fail, |
| 245 'mixin_mixin2_test': skip_fail, | 250 'mixin_mixin2_test': skip_fail, |
| 246 'mixin_mixin3_test': skip_fail, | 251 'mixin_mixin3_test': skip_fail, |
| 247 'mixin_mixin4_test': skip_fail, | 252 'mixin_mixin4_test': skip_fail, |
| 248 'mixin_mixin5_test': skip_fail, | 253 'mixin_mixin5_test': skip_fail, |
| 249 'mixin_mixin6_test': skip_fail, | 254 'mixin_mixin6_test': skip_fail, |
| 250 'mixin_mixin7_test': skip_fail, | 255 'mixin_mixin7_test': skip_fail, |
| 251 'mixin_mixin_bound2_test': skip_fail, | 256 'mixin_mixin_bound2_test': skip_fail, |
| 252 'mixin_mixin_bound_test': skip_fail, | 257 'mixin_mixin_bound_test': skip_fail, |
| 253 'mixin_mixin_test': skip_fail, | 258 'mixin_mixin_test': skip_fail, |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 'reflected_type_special_types_test': fail, | 687 'reflected_type_special_types_test': fail, |
| 683 'reflected_type_test_none_multi': fail, | 688 'reflected_type_test_none_multi': fail, |
| 684 'reflected_type_typedefs_test': fail, | 689 'reflected_type_typedefs_test': fail, |
| 685 'reflected_type_typevars_test': fail, | 690 'reflected_type_typevars_test': fail, |
| 686 'reflectively_instantiate_uninstantiated_class_test': fail, | 691 'reflectively_instantiate_uninstantiated_class_test': fail, |
| 687 'regress_14304_test': fail, | 692 'regress_14304_test': fail, |
| 688 'regress_26187_test': fail, | 693 'regress_26187_test': fail, |
| 689 'relation_assignable_test': fail, | 694 'relation_assignable_test': fail, |
| 690 'relation_subtype_test': fail, | 695 'relation_subtype_test': fail, |
| 691 'set_field_with_final_test': fail, | 696 'set_field_with_final_test': fail, |
| 697 'spawn_function_root_library_test': skip_fail, |
| 692 'symbol_validation_test_01_multi': fail, | 698 'symbol_validation_test_01_multi': fail, |
| 693 'symbol_validation_test_none_multi': fail, | 699 'symbol_validation_test_none_multi': fail, |
| 694 'to_string_test': fail, | 700 'to_string_test': fail, |
| 695 'type_argument_is_type_variable_test': fail, | 701 'type_argument_is_type_variable_test': fail, |
| 696 'type_variable_is_static_test': fail, | 702 'type_variable_is_static_test': fail, |
| 697 'type_variable_owner_test_01_multi': fail, | 703 'type_variable_owner_test_01_multi': fail, |
| 698 'type_variable_owner_test_none_multi': fail, | 704 'type_variable_owner_test_none_multi': fail, |
| 699 'typedef_deferred_library_test': skip_fail, // Isolate spawn not support | 705 'typedef_deferred_library_test': skip_fail, // Isolate spawn not support |
| 700 'typedef_library_test': fail, | 706 'typedef_library_test': fail, |
| 701 'typedef_metadata_test': fail, | 707 'typedef_metadata_test': fail, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 return null; | 770 return null; |
| 765 } catch (e) { | 771 } catch (e) { |
| 766 return e; | 772 return e; |
| 767 } | 773 } |
| 768 }; | 774 }; |
| 769 | 775 |
| 770 test(name, function(done) { // 'function' to allow `this.timeout`. | 776 test(name, function(done) { // 'function' to allow `this.timeout`. |
| 771 async_helper.asyncTestInitialize(done); | 777 async_helper.asyncTestInitialize(done); |
| 772 console.debug('Running test: ' + name); | 778 console.debug('Running test: ' + name); |
| 773 | 779 |
| 780 var result = null; |
| 774 let mainLibrary = require(module)[libraryName(name)]; | 781 let mainLibrary = require(module)[libraryName(name)]; |
| 775 let negative = /negative_test/.test(name); | 782 let negative = /negative_test/.test(name); |
| 776 if (has('slow')) this.timeout(10000); | 783 if (has('slow')) this.timeout(10000); |
| 777 if (has('fail')) { | 784 if (has('fail')) { |
| 778 let e = protect(mainLibrary.main); | 785 let e = protect(mainLibrary.main); |
| 779 if (negative) { | 786 if (negative) { |
| 780 if (e != null) { | 787 if (e != null) { |
| 781 throw new Error( | 788 throw new Error( |
| 782 "negative test marked as 'fail' " + | 789 "negative test marked as 'fail' " + |
| 783 "but passed by throwing:\n" + e); | 790 "but passed by throwing:\n" + e); |
| 784 } | 791 } |
| 785 } else { | 792 } else { |
| 786 if (e == null) { | 793 if (e == null) { |
| 787 throw new Error("test marked as 'fail' but passed"); | 794 throw new Error("test marked as 'fail' but passed"); |
| 788 } | 795 } |
| 789 } | 796 } |
| 790 } else { | 797 } else { |
| 791 try { | 798 try { |
| 792 if (negative) { | 799 if (negative) { |
| 793 assert.throws(mainLibrary.main); | 800 assert.throws(mainLibrary.main); |
| 794 } else { | 801 } else { |
| 795 mainLibrary.main(); | 802 result = mainLibrary.main(); |
| 796 } | 803 } |
| 797 } finally { | 804 } finally { |
| 798 minitest.finishTests(); | 805 minitest.finishTests(); |
| 799 } | 806 } |
| 800 } | 807 } |
| 801 | 808 |
| 802 // If the test left any lingering detritus in the DOM, blow it away | 809 // If the test left any lingering detritus in the DOM, blow it away |
| 803 // so it doesn't interfere with later tests. | 810 // so it doesn't interfere with later tests. |
| 804 document.body.innerHTML = ''; | 811 document.body.innerHTML = ''; |
| 805 console.log("cleared"); | 812 console.log("cleared"); |
| 806 | 813 |
| 807 if (!async_helper.asyncTestStarted) done(); | 814 if (!async_helper.asyncTestStarted) { |
| 815 if (!result) { |
| 816 done(); |
| 817 } else { |
| 818 result.then(dart_sdk.dart.dynamic)(() => done()); |
| 819 } |
| 820 } |
| 808 }); | 821 }); |
| 809 } | 822 } |
| 810 } | 823 } |
| 811 | 824 |
| 812 let mochaOnError; | 825 let mochaOnError; |
| 813 // We run these tests in a mocha test wrapper to avoid the confusing failure | 826 // We run these tests in a mocha test wrapper to avoid the confusing failure |
| 814 // case of dart unittests being interleaved with mocha tests. | 827 // case of dart unittests being interleaved with mocha tests. |
| 815 // In practice we are really just suppressing all mocha test behavior while | 828 // In practice we are really just suppressing all mocha test behavior while |
| 816 // Dart unittests run and then re-enabling it when the dart tests complete. | 829 // Dart unittests run and then re-enabling it when the dart tests complete. |
| 817 html_config.useHtmlConfiguration(); | 830 html_config.useHtmlConfiguration(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 | 878 |
| 866 for (let action of unittest_tests) { | 879 for (let action of unittest_tests) { |
| 867 try { | 880 try { |
| 868 action(); | 881 action(); |
| 869 } catch (e) { | 882 } catch (e) { |
| 870 console.error("Caught error tying to setup test:", e); | 883 console.error("Caught error tying to setup test:", e); |
| 871 } | 884 } |
| 872 } | 885 } |
| 873 }); | 886 }); |
| 874 }); | 887 }); |
| OLD | NEW |