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") 15import("test_src_functionalext_supplement_stdio.gni") 16 17foreach(s, functionalext_supplement_stdio_test) { 18 test_unittest(s) { 19 target_dir = "functionalext/supplement/stdio" 20 } 21} 22 23ohos_executable("fdsan_test") { 24 subsystem_name = "thirdparty" 25 part_name = "musl" 26 27 sources = [ "fdsan_test.c" ] 28 29 include_dirs = [ 30 "//${test_dir}/src/functionalext/common", 31 "//${test_dir}/src/common", 32 "${musl_src_base}/src/internal", 33 "${musl_src_base}/arch/${musl_arch}", 34 ] 35 36 configs = [ "//third_party/musl/libc-test/src/common:config_unittest" ] 37 38 deps = [ "//third_party/musl:create_porting_src" ] 39 40 cflags = [ 41 "-Wno-int-to-void-pointer-cast", 42 "-Wno-void-pointer-to-int-cast", 43 ] 44 45 ohos_test = true 46 test_output_dir = "${root_out_dir}/musl/libc-test" 47} 48 49group("functionalext_supplement_stdio_test") { 50 testonly = true 51 deps = [ 52 ":fdsan", 53 ":fdsan_test", 54 ] 55 foreach(s, functionalext_supplement_stdio_test) { 56 deps += [ ":${s}" ] 57 } 58} 59 60ohos_executable("fdsan") { 61 subsystem_name = "thirdparty" 62 part_name = "musl" 63 64 sources = [ "fdsan.cpp" ] 65 66 include_dirs = [ 67 "//${test_dir}/src/functionalext/common", 68 "//${test_dir}/src/common", 69 "${musl_src_base}/src/internal", 70 ] 71 72 configs = [ "//third_party/musl/libc-test/src/common:config_unittest" ] 73 74 deps = [ "//third_party/musl:create_porting_src" ] 75 76 external_deps = [ "bounds_checking_function:libsec_shared" ] 77 78 cflags = [ 79 "-Wno-int-to-void-pointer-cast", 80 "-Wno-void-pointer-to-int-cast", 81 ] 82 83 libs = [ "${musl_lib_dir}/libc.a" ] 84 ohos_test = true 85 test_output_dir = "${root_out_dir}/musl/libc-test" 86} 87