1# Copyright (c) 2025 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/common_components/tests/test_helper.gni") 15 16module_output_path = "common_component" 17 18host_unittest_action("Allocator_Test") { 19 module_out_path = module_output_path 20 21 sources = [ 22 # test file 23 "allocator_test.cpp", 24 ] 25 26 configs = [ 27 "//arkcompiler/ets_runtime/common_components:common_components_test_config", 28 "//arkcompiler/ets_runtime:icu_path_test_config", 29 ] 30 31 deps = [ "//arkcompiler/ets_runtime/common_components:libark_common_components_test" ] 32 33 # hiviewdfx libraries 34 external_deps = [ 35 "icu:shared_icui18n", 36 "icu:shared_icuuc", 37 "zlib:libz", 38 ] 39} 40 41 42host_unittest_action("Region_Manager_Test") { 43 module_out_path = module_output_path 44 45 sources = [ 46 # test file 47 "region_manager_test.cpp", 48 ] 49 50 configs = [ 51 "//arkcompiler/ets_runtime/common_components:common_components_test_config", 52 "//arkcompiler/ets_runtime:icu_path_test_config", 53 ] 54 55 deps = [ "//arkcompiler/ets_runtime/common_components:libark_common_components_test" ] 56 57 # hiviewdfx libraries 58 external_deps = [ 59 "icu:shared_icui18n", 60 "icu:shared_icuuc", 61 "zlib:libz", 62 "bounds_checking_function:libsec_shared", 63 ] 64} 65 66host_unittest_action("Treap_Test") { 67 module_out_path = module_output_path 68 69 sources = [ 70 # test file 71 "treap_test.cpp", 72 ] 73 74 configs = [ 75 "//arkcompiler/ets_runtime/common_components:common_components_test_config", 76 "//arkcompiler/ets_runtime:icu_path_test_config", 77 ] 78 79 deps = [ "//arkcompiler/ets_runtime/common_components:libark_common_components_test" ] 80 81 # hiviewdfx libraries 82 external_deps = [ 83 "icu:shared_icui18n", 84 "icu:shared_icuuc", 85 "zlib:libz", 86 ] 87} 88 89host_unittest_action("Region_Space_Test") { 90 module_out_path = module_output_path 91 92 sources = [ 93 # test file 94 "region_space_test.cpp", 95 ] 96 97 configs = [ 98 "//arkcompiler/ets_runtime/common_components:common_components_test_config", 99 "//arkcompiler/ets_runtime:icu_path_test_config", 100 ] 101 102 deps = [ "//arkcompiler/ets_runtime/common_components:libark_common_components_test" ] 103 104 # hiviewdfx libraries 105 external_deps = [ 106 "bounds_checking_function:libsec_shared", 107 "icu:shared_icui18n", 108 "icu:shared_icuuc", 109 "zlib:libz", 110 ] 111} 112 113host_unittest_action("Heap_Allocator_Test") { 114 module_out_path = module_output_path 115 116 sources = [ 117 # test file 118 "heap_allocator_test.cpp", 119 ] 120 121 configs = [ 122 "//arkcompiler/ets_runtime/common_components:common_components_test_config", 123 "//arkcompiler/ets_runtime:icu_path_test_config", 124 ] 125 126 deps = [ "//arkcompiler/ets_runtime/common_components:libark_common_components_test" ] 127 128 # hiviewdfx libraries 129 external_deps = [ 130 "icu:shared_icui18n", 131 "icu:shared_icuuc", 132 "zlib:libz", 133 ] 134} 135 136group("unittest") { 137 testonly = true 138 139 # deps file 140 deps = [ 141 ":Allocator_Test", 142 ":Treap_Test", 143 ":Region_Space_Test", 144 ":Heap_Allocator_Test", 145 ":Region_Manager_Test" 146 ] 147} 148 149group("host_unittest") { 150 testonly = true 151 152 # deps file 153 deps = [ 154 ":Allocator_TestAction", 155 ":Treap_TestAction", 156 ":Region_Space_TestAction", 157 ":Heap_Allocator_TestAction", 158 ":Region_Manager_TestAction" 159 ] 160} 161