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 "file_path_helper_test.cpp", 54 "gc_ring_buffer_test.cpp", 55 "json_parser_test.cpp", 56 "json_stringifier_test.cpp", 57 "math_helper_test.cpp", 58 ] 59 60 configs = [ 61 "../../../:ecma_test_config", 62 "../../../:icu_path_test_config", 63 ] 64 65 deps = [ 66 "$ark_third_party_root/icu/icu4c:shared_icui18n", 67 "$ark_third_party_root/icu/icu4c:shared_icuuc", 68 "../../../:libark_jsruntime_test", 69 sdk_libc_secshared_dep, 70 ] 71 72 # hiviewdfx libraries 73 external_deps = hiviewdfx_ext_deps 74 deps += hiviewdfx_deps 75} 76 77host_unittest_action("Base_003_Test") { 78 module_out_path = module_output_path 79 80 sources = [ 81 # test file 82 "number_helper_test.cpp", 83 "string_helper_test.cpp", 84 "typed_array_helper_test.cpp", 85 "utf_helper_test.cpp", 86 ] 87 88 configs = [ 89 "../../../:ecma_test_config", 90 "../../../:icu_path_test_config", 91 ] 92 93 deps = [ 94 "$ark_third_party_root/icu/icu4c:shared_icui18n", 95 "$ark_third_party_root/icu/icu4c:shared_icuuc", 96 "../../../:libark_jsruntime_test", 97 sdk_libc_secshared_dep, 98 ] 99 100 # hiviewdfx libraries 101 external_deps = hiviewdfx_ext_deps 102 deps += hiviewdfx_deps 103} 104 105group("unittest") { 106 testonly = true 107 108 # deps file 109 deps = [ 110 ":Base_001_Test", 111 ":Base_002_Test", 112 ":Base_003_Test", 113 ] 114} 115 116group("host_unittest") { 117 testonly = true 118 119 # deps file 120 deps = [ 121 ":Base_001_TestAction", 122 ":Base_002_TestAction", 123 ":Base_003_TestAction", 124 ] 125 if (is_mac) { 126 deps -= [ 127 ":Base_001_TestAction", 128 ":Base_002_TestAction", 129 ":Base_003_TestAction", 130 ] 131 } 132} 133