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/PinAuth_UT_test" 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_2.1", 77 "googletest:gmock", 78 "hilog:libhilog", 79 "init:libbegetutil", 80 "ipc:ipc_single", 81 "openssl:libcrypto_shared", 82 "safwk:system_ability_fwk", 83 "samgr:samgr_proxy", 84 "user_auth_framework:userauth_client", 85 "user_auth_framework:userauth_executors", 86 ] 87 88 remove_configs = [ "//build/config/compiler:no_exceptions" ] 89 90 configs = [ 91 "../../frameworks:pinauth_config", 92 "../../common:iam_log_config", 93 "../../frameworks/:pinauth_ipc_config", 94 "../../common:iam_utils_config", 95 ] 96 97 subsystem_name = "useriam" 98 part_name = "pin_auth" 99} 100 101ohos_unittest("PinAuth_Service_test") { 102 sanitize = { 103 integer_overflow = true 104 ubsan = true 105 boundary_sanitize = true 106 cfi = true 107 cfi_cross_dso = true 108 debug = false 109 blocklist = "../../cfi_blocklist.txt" 110 } 111 branch_protector_ret = "pac_ret" 112 module_out_path = module_output_path 113 114 sources = [ "src/pinauth_test.cpp" ] 115 116 include_dirs = [ 117 "inc", 118 "../../interfaces/inner_api", 119 ] 120 121 deps = [ "../../services:pinauthservice" ] 122 123 external_deps = [ 124 "c_utils:utils", 125 "hilog:libhilog", 126 "ipc:ipc_single", 127 "pin_auth:pinauth_framework", 128 "safwk:system_ability_fwk", 129 ] 130 131 remove_configs = [ "//build/config/compiler:no_exceptions" ] 132 133 configs = [ 134 "../../common:iam_log_config", 135 "../../frameworks/:pinauth_ipc_config", 136 "../../common:iam_utils_config", 137 ] 138 139 subsystem_name = "useriam" 140 part_name = "pin_auth" 141} 142