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("../../../test_template.gni") 15 16group("dlns_test") { 17 testonly = true 18 deps = [ 19 ":dlns_dlopen_ext_test", 20 ":dlns_dlopen_test", 21 ":dlns_dlsym_dep_a", 22 ":dlns_dlsym_test", 23 ":dlns_inherit_test", 24 ":dlns_separated_test", 25 ":dlns_set_fun_test", 26 ":dlns_special_scene_test", 27 ":dlopen_fill_random", 28 ":dlopen_hash_sysv", 29 ] 30} 31 32ohos_executable("dlns_dlopen_test") { 33 subsystem_name = "musl" 34 part_name = "libc-test" 35 include_dirs = [ 36 "../common", 37 "//third_party/musl/porting/linux/user/include", 38 "//third_party/musl/libc-test/src/common", 39 ] 40 if (musl_arch == "arm") { 41 defines = [ "MUSL_ARM" ] 42 } 43 sources = [ "dlns_dlopen.c" ] 44 configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ] 45 46 ldflags = [ "-Wl,-rpath=/data/tests/libc-test/src/" ] 47} 48 49ohos_executable("dlns_set_fun_test") { 50 subsystem_name = "musl" 51 part_name = "libc-test" 52 include_dirs = [ 53 "../common", 54 "//third_party/musl/porting/linux/user/include", 55 "//third_party/musl/libc-test/src/common", 56 ] 57 58 sources = [ "dlns_set_fun.c" ] 59 configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ] 60 if (!musl_unit_test_flag) { 61 libs = [ "${musl_lib_dir}/libc.a" ] 62 } 63} 64 65ohos_executable("dlns_inherit_test") { 66 subsystem_name = "musl" 67 part_name = "libc-test" 68 include_dirs = [ 69 "../common", 70 "//third_party/musl/porting/linux/user/include", 71 "//third_party/musl/libc-test/src/common", 72 ] 73 74 sources = [ "dlns_inherit.c" ] 75 configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ] 76 if (!musl_unit_test_flag) { 77 libs = [ "${musl_lib_dir}/libc.a" ] 78 } 79} 80 81ohos_executable("dlns_separated_test") { 82 subsystem_name = "musl" 83 part_name = "libc-test" 84 include_dirs = [ 85 "../common", 86 "//third_party/musl/porting/linux/user/include", 87 "//third_party/musl/libc-test/src/common", 88 ] 89 90 sources = [ "dlns_separated.c" ] 91 configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ] 92 if (!musl_unit_test_flag) { 93 libs = [ "${musl_lib_dir}/libc.a" ] 94 } 95} 96 97ohos_executable("dlns_special_scene_test") { 98 subsystem_name = "musl" 99 part_name = "libc-test" 100 include_dirs = [ 101 "../common", 102 "//third_party/musl/porting/linux/user/include", 103 "//third_party/musl/libc-test/src/common", 104 ] 105 106 sources = [ "dlns_special_scene.c" ] 107 configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ] 108} 109 110ohos_executable("dlns_dlsym_test") { 111 subsystem_name = "musl" 112 part_name = "libc-test" 113 include_dirs = [ 114 "../common", 115 "//third_party/musl/porting/linux/user/include", 116 "//third_party/musl/libc-test/src/common", 117 ] 118 119 sources = [ "dlns_dlsym.c" ] 120 configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ] 121} 122 123ohos_executable("dlns_dlopen_ext_test") { 124 subsystem_name = "musl" 125 part_name = "libc-test" 126 include_dirs = [ "../common" ] 127 128 sources = [ "dlns_dlopen_ext.c" ] 129 configs = [ "//third_party/musl/libc-test/src/common:config_runtest" ] 130} 131 132ohos_shared_library("dlns_dlsym_dep_c") { 133 include_dirs = [ "." ] 134 135 sources = [ "dlns_dlsym_dep_c.c" ] 136 137 output_name = "dlns_dlsym_dep_c" 138 139 output_extension = "so" 140 141 subsystem_name = "musl" 142 part_name = "libc-test-lib" 143} 144 145ohos_shared_library("dlns_dlsym_dep_b") { 146 include_dirs = [ "." ] 147 148 sources = [ "dlns_dlsym_dep_b.c" ] 149 150 output_name = "dlns_dlsym_dep_b" 151 152 output_extension = "so" 153 154 deps = [ ":dlns_dlsym_dep_c" ] 155 156 subsystem_name = "musl" 157 part_name = "libc-test-lib" 158} 159 160ohos_shared_library("dlns_dlsym_dep_a") { 161 include_dirs = [ "." ] 162 163 sources = [ "dlns_dlsym_dep_a.c" ] 164 165 output_name = "dlns_dlsym_dep_a" 166 167 output_extension = "so" 168 169 deps = [ ":dlns_dlsym_dep_b" ] 170 171 subsystem_name = "musl" 172 part_name = "libc-test-lib" 173} 174 175ohos_shared_library("dlopen_hash_sysv") { 176 include_dirs = [ "." ] 177 178 sources = [ "dlns_dlsym_dep_c.c" ] 179 180 output_name = "dlopen_hash_sysv" 181 182 output_extension = "so" 183 184 subsystem_name = "musl" 185 part_name = "libc-test-lib" 186 187 ldflags = [ "-Wl,--hash-style=sysv" ] 188} 189 190ohos_shared_library("dlopen_fill_random") { 191 include_dirs = [ "." ] 192 193 sources = [ "dlns_dlsym_dep_c.c" ] 194 195 stack_protector_ret = true 196 197 output_name = "dlopen_fill_random" 198 199 output_extension = "so" 200 201 subsystem_name = "musl" 202 part_name = "libc-test-lib" 203} 204