1# Copyright (c) 2021 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("//arkcompiler/ets_runtime/js_runtime_config.gni") 15import("//arkcompiler/ets_runtime/test/test_helper.gni") 16 17module_output_path = "arkcompiler/ets_runtime" 18 19host_unittest_action("Base_001_Test") { 20 module_out_path = module_output_path 21 22 sources = [ 23 # test file 24 "array_helper_test.cpp", 25 "atomic_helper_test.cpp", 26 "bit_helper_test.cpp", 27 "builtins_base_test.cpp", 28 "error_helper_test.cpp", 29 ] 30 31 configs = [ 32 "../../../:ecma_test_config", 33 "../../../:icu_path_test_config", 34 ] 35 36 deps = [ 37 "$ark_third_party_root/icu/icu4c:shared_icui18n", 38 "$ark_third_party_root/icu/icu4c:shared_icuuc", 39 "../../../:libark_jsruntime_test", 40 sdk_libc_secshared_dep, 41 ] 42 43 # hiviewdfx libraries 44 external_deps = hiviewdfx_ext_deps 45 deps += hiviewdfx_deps 46} 47 48host_unittest_action("Base_002_Test") { 49 module_out_path = module_output_path 50 51 sources = [ 52 # test file 53 "ason_test.cpp", 54 "file_path_helper_test.cpp", 55 "gc_ring_buffer_test.cpp", 56 "json_parser_test.cpp", 57 "json_stringifier_test.cpp", 58 "math_helper_test.cpp", 59 ] 60 61 configs = [ 62 "../../../:ecma_test_config", 63 "../../../:icu_path_test_config", 64 ] 65 66 deps = [ 67 "$ark_third_party_root/icu/icu4c:shared_icui18n", 68 "$ark_third_party_root/icu/icu4c:shared_icuuc", 69 "../../../:libark_jsruntime_test", 70 sdk_libc_secshared_dep, 71 ] 72 73 # hiviewdfx libraries 74 external_deps = hiviewdfx_ext_deps 75 deps += hiviewdfx_deps 76} 77 78host_unittest_action("Base_003_Test") { 79 module_out_path = module_output_path 80 81 sources = [ 82 # test file 83 "dtoa_helper_test.cpp", 84 "number_helper_test.cpp", 85 "string_helper_test.cpp", 86 "typed_array_helper_test.cpp", 87 "utf_helper_test.cpp", 88 ] 89 90 configs = [ 91 "../../../:ecma_test_config", 92 "../../../:icu_path_test_config", 93 ] 94 95 deps = [ 96 "$ark_third_party_root/icu/icu4c:shared_icui18n", 97 "$ark_third_party_root/icu/icu4c:shared_icuuc", 98 "../../../:libark_jsruntime_test", 99 sdk_libc_secshared_dep, 100 ] 101 102 # hiviewdfx libraries 103 external_deps = hiviewdfx_ext_deps 104 deps += hiviewdfx_deps 105} 106 107group("unittest") { 108 testonly = true 109 110 # deps file 111 deps = [ 112 ":Base_001_Test", 113 ":Base_002_Test", 114 ":Base_003_Test", 115 ] 116} 117 118group("host_unittest") { 119 testonly = true 120 121 # deps file 122 deps = [ 123 ":Base_001_TestAction", 124 ":Base_002_TestAction", 125 ":Base_003_TestAction", 126 ] 127 if (is_mac) { 128 deps -= [ 129 ":Base_001_TestAction", 130 ":Base_002_TestAction", 131 ":Base_003_TestAction", 132 ] 133 } 134} 135