1# Copyright (c) 2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/lite/config/component/lite_component.gni") 15import("//third_party/jerryscript/engine.gni") 16import("//third_party/jerryscript/tests/test_helper.gni") 17 18host_unittest_action("TddTest") { 19 module_out_path = module_output_path 20 include_dirs = [ 21 "${core_path}/include", 22 "${core_path}/api", 23 "${core_path}/debugger", 24 "${core_path}/ecma/builtin-objects/typedarray", 25 "${core_path}/ext", 26 "${core_path}/parser", 27 "${core_path}/parser/js", 28 "${core_path}/parser/regexp", 29 "${core_path}/vm", 30 "${core_path}", 31 "test-common.h", 32 "${ext_path}", 33 "${ext_path}/common", 34 "${ext_path}/debugger", 35 "${ext_path}/handle-scope", 36 "${ext_path}/include/jerryscript-ext", 37 "${ext_path}/include", 38 "${libm_path}", 39 "${debugger_path}", 40 "${port_path}", 41 "${engine_path}/jerry-main", 42 "${port_path}/default/include", 43 "${core_path}/ecma/base", 44 "${core_path}/ecma/operations", 45 "${core_path}/vm", 46 "${core_path}/jcontext", 47 "${core_path}/jmem", 48 "${core_path}/parser/js", 49 "${core_path}/parser/regexp", 50 "${core_path}/jrt", 51 "${core_path}/lit", 52 "${core_path}/ecma/builtin-objects", 53 "//commonlibrary/utils_lite/memory/include", 54 "//commonlibrary/utils_lite/include", 55 ] 56 57 external_deps = [ 58 "bounds_checking_function:libsec_static", 59 "googletest:gtest", 60 "googletest:gtest_main", 61 ] 62 63 deps = [ 64 "//third_party/jerryscript:jerry", 65 "//third_party/jerryscript:jerry-snapshot", 66 "//third_party/jerryscript:libjerryscript", 67 ] 68 69 cflags = [ 70 "-Wno-unused-function", 71 "-Wno-sign-compare", 72 "-Wno-implicit-fallthrough", 73 ] 74 defines = [ 75 "JERRY_FOR_IAR_CONFIG", 76 "JERRY_GC_LIMIT=(0)", 77 "JERRY_CPOINTER_32_BIT=0", 78 "JERRY_ERROR_MESSAGES=1", 79 "JERRY_PARSER=1", 80 "JERRY_LINE_INFO=1", 81 "JERRY_LOGGING=0", 82 "JERRY_DEBUGGER=0", 83 "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0", 84 "JERRY_PARSER_DUMP_BYTE_CODE=0", 85 "JERRY_ES2015=0", 86 "JERRY_REGEXP_STRICT_MODE=0", 87 "JERRY_REGEXP_DUMP_BYTE_CODE=0", 88 "JERRY_SNAPSHOT_EXEC=1", 89 "JERRY_SNAPSHOT_SAVE=1", 90 "JERRY_SYSTEM_ALLOCATOR=0", 91 "JERRY_VALGRIND=0", 92 "JERRY_VM_EXEC_STOP=0", 93 "JERRY_STACK_LIMIT=(8)", 94 "JERRY_IAR_JUPITER", 95 "INPUTJS_BUFFER_SIZE=64*1024", 96 "SNAPSHOT_BUFFER_SIZE=48*1024", 97 "JERRY_COMMIT_HASH=\"ignored\"", 98 "JERRY_NDEBUG", 99 "JERRY_HEAPDUMP", 100 "JERRY_REF_TRACKER", 101 "JERRY_ES2015_BUILTIN_TYPEDARRAY=1", 102 ] 103 if (jerryscript_enable_external_context == true) { 104 defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] 105 } 106 sources = [ 107 "test-abort.cpp", 108 "test-api-binary-operations-arithmetics.cpp", 109 "test-api-binary-operations-comparisons.cpp", 110 "test-api-binary-operations-instanceof.cpp", 111 "test-api-errortype.cpp", 112 "test-api-promise.cpp", 113 "test-api-property.cpp", 114 "test-api-set-and-clear-error-flag.cpp", 115 "test-api-strings.cpp", 116 "test-api-value-type.cpp", 117 "test-api.cpp", 118 "test-arraybuffer.cpp", 119 "test-container.cpp", 120 "test-context-data.cpp", 121 "test-dataview.cpp", 122 "test-date-helpers.cpp", 123 "test-exec-stop.cpp", 124 "test-has-property.cpp", 125 "test-internal-properties.cpp", 126 "test-jmem.cpp", 127 "test-lit-char-helpers.cpp", 128 "test-native-callback-nested.cpp", 129 "test-native-instanceof.cpp", 130 "test-newtarget.cpp", 131 "test-number-to-int32.cpp", 132 "test-number-to-string.cpp", 133 "test-objects-foreach.cpp", 134 "test-poolman.cpp", 135 "test-promise.cpp", 136 "test-proxy.cpp", 137 "test-regression-3588.cpp", 138 "test-resource-name.cpp", 139 "test-string-to-number.cpp", 140 "test-symbol.cpp", 141 "test-to-integer.cpp", 142 "test-to-length.cpp", 143 "test-typedarray.cpp", 144 "test-unicode.cpp", 145 ] 146} 147 148group("jerry_tdd_test") { 149 testonly = true 150 deps = [ ":TddTest" ] 151} 152group("jerry_tdd_host_test") { 153 testonly = true 154 deps = [ ":TddTestAction" ] 155} 156 157#jerry es2015 test for host running 158group("jerry_host_jstest_es2015") { 159 testonly = true 160 deps = [ 161 "//third_party/jerryscript/tests/jerry:jerry_host_js_test_es2015", 162 "//third_party/jerryscript/tests/unit-core:jerry_tdd_host_test", 163 ] 164} 165 166#jerry es5.1 test for host running 167group("jerry_host_jstest_es5.1") { 168 testonly = true 169 deps = [ 170 "//third_party/jerryscript/tests/jerry:jerry_host_js_test_es5.1", 171 "//third_party/jerryscript/tests/unit-core:jerry_tdd_host_test", 172 ] 173}