1# Copyright (c) 2023 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("//build/test.gni") 15import("../../../../security_component.gni") 16 17sec_comp_root_dir = "../../../.." 18 19ohos_unittest("sec_comp_sdk_test") { 20 subsystem_name = "security" 21 part_name = "security_component_manager" 22 module_out_path = part_name + "/" + part_name 23 24 include_dirs = [ 25 "${sec_comp_root_dir}/frameworks/common/include", 26 "${sec_comp_root_dir}/frameworks/security_component/include", 27 "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", 28 ] 29 30 sources = [ 31 "unittest/src/location_button_test.cpp", 32 "unittest/src/paste_button_test.cpp", 33 "unittest/src/save_button_test.cpp", 34 "unittest/src/sec_comp_kit_test.cpp", 35 "unittest/src/test_common.cpp", 36 ] 37 configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] 38 cflags_cc = [ "-DHILOG_ENABLE" ] 39 40 if (security_component_enhance_enable) { 41 cflags_cc += [ "-DSECURITY_COMPONENT_ENHANCE_ENABLE" ] 42 } 43 44 deps = [ 45 "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", 46 "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", 47 ] 48 49 external_deps = [ 50 "access_token:libaccesstoken_sdk", 51 "c_utils:utils", 52 "hilog:libhilog", 53 "hisysevent:libhisysevent", 54 "ipc:ipc_core", 55 ] 56} 57 58ohos_unittest("sec_comp_register_callback_test") { 59 subsystem_name = "security" 60 part_name = "security_component_manager" 61 module_out_path = part_name + "/" + part_name 62 63 include_dirs = [ 64 "${sec_comp_root_dir}/frameworks/common/include", 65 "${sec_comp_root_dir}/frameworks/security_component/include", 66 "${sec_comp_root_dir}/interfaces/inner_api/security_component/include", 67 ] 68 69 sources = [ 70 "unittest/src/sec_comp_register_callback_test.cpp", 71 "unittest/src/test_common.cpp", 72 ] 73 configs = [ "${sec_comp_root_dir}/config:coverage_flags" ] 74 cflags_cc = [ "-DHILOG_ENABLE" ] 75 76 if (security_component_enhance_enable) { 77 cflags_cc += [ "-DSECURITY_COMPONENT_ENHANCE_ENABLE" ] 78 } 79 80 deps = [ 81 "${sec_comp_root_dir}/frameworks:libsecurity_component_enhance_adapter", 82 "${sec_comp_root_dir}/frameworks:libsecurity_component_framework", 83 "${sec_comp_root_dir}/interfaces/inner_api/security_component:libsecurity_component_sdk", 84 ] 85 86 external_deps = [ 87 "access_token:libaccesstoken_sdk", 88 "access_token:libtoken_setproc", 89 "c_utils:utils", 90 "hilog:libhilog", 91 "hisysevent:libhisysevent", 92 "ipc:ipc_core", 93 ] 94} 95 96group("unittest") { 97 testonly = true 98 deps = [ 99 ":sec_comp_register_callback_test", 100 ":sec_comp_sdk_test", 101 ] 102} 103