1# Copyright (C) 2022-2024 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/ohos.gni") 15import("//build/test.gni") 16 17module_output_path = "pin_auth/pin_auth" 18 19ohos_unittest("PinAuth_UT_test") { 20 sanitize = { 21 integer_overflow = true 22 ubsan = true 23 boundary_sanitize = true 24 cfi = true 25 cfi_cross_dso = true 26 debug = false 27 blocklist = "../../cfi_blocklist.txt" 28 } 29 branch_protector_ret = "pac_ret" 30 module_out_path = module_output_path 31 32 cflags = [ 33 "-Dprivate=public", 34 "-Dprotected=public", 35 ] 36 37 sources = [ 38 "src/framework_client_pinauth_register_impl_test.cpp", 39 "src/framework_scrypt_scrypt_test.cpp", 40 "src/inputer_data_impl_test.cpp", 41 "src/inputer_get_data_proxy_test.cpp", 42 "src/inputer_get_data_service_test.cpp", 43 "src/inputer_get_data_stub_test.cpp", 44 "src/inputer_set_data_proxy_test.cpp", 45 "src/inputer_set_data_stub_test.cpp", 46 "src/pin_auth_all_in_one_hdi_unit_test.cpp", 47 "src/pin_auth_collector_hdi_unit_test.cpp", 48 "src/pin_auth_driver_hdi_unit_test.cpp", 49 "src/pin_auth_executor_callback_hdi_unit_test.cpp", 50 "src/pin_auth_load_mode_test.cpp", 51 "src/pin_auth_proxy_test.cpp", 52 "src/pin_auth_register_test.cpp", 53 "src/pin_auth_service_test.cpp", 54 "src/pin_auth_stub_test.cpp", 55 "src/pin_auth_verifier_hdi_unit_test.cpp", 56 "src/services_inputer_data_impl_test.cpp", 57 "src/services_pin_auth_manager_test.cpp", 58 ] 59 60 include_dirs = [ 61 "inc", 62 "mocks", 63 ] 64 65 deps = [ 66 "../../frameworks:pinauth_framework_source_set", 67 "../../frameworks:pinauth_ipc", 68 "../../services:pinauthservice_source_set", 69 ] 70 71 external_deps = [ 72 "access_token:libaccesstoken_sdk", 73 "access_token:libnativetoken", 74 "access_token:libtoken_setproc", 75 "c_utils:utils", 76 "drivers_interface_pin_auth:libpin_auth_proxy_3.0", 77 "googletest:gmock", 78 "hdf_core:libhdf_utils", 79 "hilog:libhilog", 80 "init:libbegetutil", 81 "ipc:ipc_single", 82 "openssl:libcrypto_shared", 83 "safwk:system_ability_fwk", 84 "samgr:samgr_proxy", 85 "user_auth_framework:userauth_client", 86 "user_auth_framework:userauth_executors", 87 ] 88 89 remove_configs = [ "//build/config/compiler:no_exceptions" ] 90 91 configs = [ 92 "../../frameworks:pinauth_config", 93 "../../common:iam_log_config", 94 "../../frameworks/:pinauth_ipc_config", 95 "../../common:iam_utils_config", 96 ] 97 98 subsystem_name = "useriam" 99 part_name = "pin_auth" 100} 101 102ohos_unittest("PinAuth_Service_test") { 103 sanitize = { 104 integer_overflow = true 105 ubsan = true 106 boundary_sanitize = true 107 cfi = true 108 cfi_cross_dso = true 109 debug = false 110 blocklist = "../../cfi_blocklist.txt" 111 } 112 branch_protector_ret = "pac_ret" 113 module_out_path = module_output_path 114 115 sources = [ "src/pinauth_test.cpp" ] 116 117 include_dirs = [ 118 "inc", 119 "../../interfaces/inner_api", 120 ] 121 122 deps = [ "../../services:pinauthservice" ] 123 124 external_deps = [ 125 "c_utils:utils", 126 "hilog:libhilog", 127 "ipc:ipc_single", 128 "pin_auth:pinauth_framework", 129 "safwk:system_ability_fwk", 130 ] 131 132 remove_configs = [ "//build/config/compiler:no_exceptions" ] 133 134 configs = [ 135 "../../common:iam_log_config", 136 "../../frameworks/:pinauth_ipc_config", 137 "../../common:iam_utils_config", 138 ] 139 140 subsystem_name = "useriam" 141 part_name = "pin_auth" 142} 143