1425bb815Sopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd. 2425bb815Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3425bb815Sopenharmony_ci# you may not use this file except in compliance with the License. 4425bb815Sopenharmony_ci# You may obtain a copy of the License at 5425bb815Sopenharmony_ci# 6425bb815Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7425bb815Sopenharmony_ci# 8425bb815Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9425bb815Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10425bb815Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11425bb815Sopenharmony_ci# See the License for the specific language governing permissions and 12425bb815Sopenharmony_ci# limitations under the License. 13425bb815Sopenharmony_ci 14425bb815Sopenharmony_ciimport("//build/lite/config/component/lite_component.gni") 15425bb815Sopenharmony_ciimport("//third_party/jerryscript/engine.gni") 16425bb815Sopenharmony_ciimport("//third_party/jerryscript/tests/test_helper.gni") 17425bb815Sopenharmony_ci 18425bb815Sopenharmony_cihost_unittest_action("TddTest") { 19425bb815Sopenharmony_ci module_out_path = module_output_path 20425bb815Sopenharmony_ci include_dirs = [ 21425bb815Sopenharmony_ci "//commonlibrary/c_utils/base/include", 22425bb815Sopenharmony_ci "${core_path}/include", 23425bb815Sopenharmony_ci "${core_path}/api", 24425bb815Sopenharmony_ci "${core_path}/debugger", 25425bb815Sopenharmony_ci "${core_path}/ecma/builtin-objects/typedarray", 26425bb815Sopenharmony_ci "${core_path}/ext", 27425bb815Sopenharmony_ci "${core_path}/parser", 28425bb815Sopenharmony_ci "${core_path}/parser/js", 29425bb815Sopenharmony_ci "${core_path}/parser/regexp", 30425bb815Sopenharmony_ci "${core_path}/vm", 31425bb815Sopenharmony_ci "${core_path}", 32425bb815Sopenharmony_ci "test-common.h", 33425bb815Sopenharmony_ci "${ext_path}", 34425bb815Sopenharmony_ci "${ext_path}/common", 35425bb815Sopenharmony_ci "${ext_path}/debugger", 36425bb815Sopenharmony_ci "${ext_path}/handle-scope", 37425bb815Sopenharmony_ci "${ext_path}/include/jerryscript-ext", 38425bb815Sopenharmony_ci "${ext_path}/include", 39425bb815Sopenharmony_ci "${libm_path}", 40425bb815Sopenharmony_ci "${debugger_path}", 41425bb815Sopenharmony_ci "${port_path}", 42425bb815Sopenharmony_ci "${engine_path}/jerry-main", 43425bb815Sopenharmony_ci "${port_path}/default/include", 44425bb815Sopenharmony_ci "${core_path}/ecma/base", 45425bb815Sopenharmony_ci "${core_path}/ecma/operations", 46425bb815Sopenharmony_ci "${core_path}/vm", 47425bb815Sopenharmony_ci "${core_path}/jcontext", 48425bb815Sopenharmony_ci "${core_path}/jmem", 49425bb815Sopenharmony_ci "${core_path}/parser/js", 50425bb815Sopenharmony_ci "${core_path}/parser/regexp", 51425bb815Sopenharmony_ci "${core_path}/jrt", 52425bb815Sopenharmony_ci "${core_path}/lit", 53425bb815Sopenharmony_ci "${core_path}/ecma/builtin-objects", 54425bb815Sopenharmony_ci "//commonlibrary/utils_lite/memory/include", 55425bb815Sopenharmony_ci "//commonlibrary/utils_lite/include", 56425bb815Sopenharmony_ci "//third_party/googletest/googletest/include/gtest", 57425bb815Sopenharmony_ci "//third_party/googletest/include", 58425bb815Sopenharmony_ci "//commonlibrary/c_utils/base/include", 59425bb815Sopenharmony_ci "//third_party/node/src", 60425bb815Sopenharmony_ci ] 61425bb815Sopenharmony_ci configs = [ "//third_party/bounds_checking_function:libsec_public_config" ] 62425bb815Sopenharmony_ci deps = [ 63425bb815Sopenharmony_ci "//third_party/bounds_checking_function:libsec_static", 64425bb815Sopenharmony_ci "//third_party/googletest:gtest", 65425bb815Sopenharmony_ci "//third_party/googletest:gtest_main", 66425bb815Sopenharmony_ci "//third_party/jerryscript:jerry", 67425bb815Sopenharmony_ci "//third_party/jerryscript:jerry-snapshot", 68425bb815Sopenharmony_ci "//third_party/jerryscript:libjerryscript", 69425bb815Sopenharmony_ci ] 70425bb815Sopenharmony_ci 71425bb815Sopenharmony_ci cflags = [ 72425bb815Sopenharmony_ci "-Wno-unused-function", 73425bb815Sopenharmony_ci "-Wno-sign-compare", 74425bb815Sopenharmony_ci "-Wno-implicit-fallthrough", 75425bb815Sopenharmony_ci ] 76425bb815Sopenharmony_ci defines = [ 77425bb815Sopenharmony_ci "JERRY_FOR_IAR_CONFIG", 78425bb815Sopenharmony_ci "JERRY_GC_LIMIT=(0)", 79425bb815Sopenharmony_ci "JERRY_CPOINTER_32_BIT=0", 80425bb815Sopenharmony_ci "JERRY_ERROR_MESSAGES=1", 81425bb815Sopenharmony_ci "JERRY_PARSER=1", 82425bb815Sopenharmony_ci "JERRY_LINE_INFO=1", 83425bb815Sopenharmony_ci "JERRY_LOGGING=0", 84425bb815Sopenharmony_ci "JERRY_DEBUGGER=0", 85425bb815Sopenharmony_ci "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0", 86425bb815Sopenharmony_ci "JERRY_PARSER_DUMP_BYTE_CODE=0", 87425bb815Sopenharmony_ci "JERRY_ES2015=0", 88425bb815Sopenharmony_ci "JERRY_REGEXP_STRICT_MODE=0", 89425bb815Sopenharmony_ci "JERRY_REGEXP_DUMP_BYTE_CODE=0", 90425bb815Sopenharmony_ci "JERRY_SNAPSHOT_EXEC=1", 91425bb815Sopenharmony_ci "JERRY_SNAPSHOT_SAVE=1", 92425bb815Sopenharmony_ci "JERRY_SYSTEM_ALLOCATOR=0", 93425bb815Sopenharmony_ci "JERRY_VALGRIND=0", 94425bb815Sopenharmony_ci "JERRY_VM_EXEC_STOP=0", 95425bb815Sopenharmony_ci "JERRY_STACK_LIMIT=(8)", 96425bb815Sopenharmony_ci "JERRY_IAR_JUPITER", 97425bb815Sopenharmony_ci "INPUTJS_BUFFER_SIZE=64*1024", 98425bb815Sopenharmony_ci "SNAPSHOT_BUFFER_SIZE=48*1024", 99425bb815Sopenharmony_ci "JERRY_COMMIT_HASH=\"ignored\"", 100425bb815Sopenharmony_ci "JERRY_NDEBUG", 101425bb815Sopenharmony_ci "JERRY_HEAPDUMP", 102425bb815Sopenharmony_ci "JERRY_REF_TRACKER", 103425bb815Sopenharmony_ci "JERRY_ES2015_BUILTIN_TYPEDARRAY=1", 104425bb815Sopenharmony_ci ] 105425bb815Sopenharmony_ci if (jerryscript_enable_external_context == true) { 106425bb815Sopenharmony_ci defines += [ "JERRY_EXTERNAL_CONTEXT=1" ] 107425bb815Sopenharmony_ci } 108425bb815Sopenharmony_ci sources = [ 109425bb815Sopenharmony_ci "test-abort.cpp", 110425bb815Sopenharmony_ci "test-api-binary-operations-arithmetics.cpp", 111425bb815Sopenharmony_ci "test-api-binary-operations-comparisons.cpp", 112425bb815Sopenharmony_ci "test-api-binary-operations-instanceof.cpp", 113425bb815Sopenharmony_ci "test-api-errortype.cpp", 114425bb815Sopenharmony_ci "test-api-promise.cpp", 115425bb815Sopenharmony_ci "test-api-property.cpp", 116425bb815Sopenharmony_ci "test-api-set-and-clear-error-flag.cpp", 117425bb815Sopenharmony_ci "test-api-strings.cpp", 118425bb815Sopenharmony_ci "test-api-value-type.cpp", 119425bb815Sopenharmony_ci "test-api.cpp", 120425bb815Sopenharmony_ci "test-arraybuffer.cpp", 121425bb815Sopenharmony_ci "test-container.cpp", 122425bb815Sopenharmony_ci "test-context-data.cpp", 123425bb815Sopenharmony_ci "test-dataview.cpp", 124425bb815Sopenharmony_ci "test-date-helpers.cpp", 125425bb815Sopenharmony_ci "test-exec-stop.cpp", 126425bb815Sopenharmony_ci "test-has-property.cpp", 127425bb815Sopenharmony_ci "test-internal-properties.cpp", 128425bb815Sopenharmony_ci "test-jmem.cpp", 129425bb815Sopenharmony_ci "test-lit-char-helpers.cpp", 130425bb815Sopenharmony_ci "test-native-callback-nested.cpp", 131425bb815Sopenharmony_ci "test-native-instanceof.cpp", 132425bb815Sopenharmony_ci "test-newtarget.cpp", 133425bb815Sopenharmony_ci "test-number-to-int32.cpp", 134425bb815Sopenharmony_ci "test-number-to-string.cpp", 135425bb815Sopenharmony_ci "test-objects-foreach.cpp", 136425bb815Sopenharmony_ci "test-poolman.cpp", 137425bb815Sopenharmony_ci "test-promise.cpp", 138425bb815Sopenharmony_ci "test-proxy.cpp", 139425bb815Sopenharmony_ci "test-regression-3588.cpp", 140425bb815Sopenharmony_ci "test-resource-name.cpp", 141425bb815Sopenharmony_ci "test-string-to-number.cpp", 142425bb815Sopenharmony_ci "test-symbol.cpp", 143425bb815Sopenharmony_ci "test-to-integer.cpp", 144425bb815Sopenharmony_ci "test-to-length.cpp", 145425bb815Sopenharmony_ci "test-typedarray.cpp", 146425bb815Sopenharmony_ci "test-unicode.cpp", 147425bb815Sopenharmony_ci ] 148425bb815Sopenharmony_ci} 149425bb815Sopenharmony_ci 150425bb815Sopenharmony_cigroup("jerry_tdd_test") { 151425bb815Sopenharmony_ci testonly = true 152425bb815Sopenharmony_ci deps = [ ":TddTest" ] 153425bb815Sopenharmony_ci} 154425bb815Sopenharmony_cigroup("jerry_tdd_host_test") { 155425bb815Sopenharmony_ci testonly = true 156425bb815Sopenharmony_ci deps = [ ":TddTestAction" ] 157425bb815Sopenharmony_ci} 158