# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("../../../access_token.gni") if (is_standard_system && ability_base_enable) { ohos_unittest("libipc_code_test") { subsystem_name = "security" part_name = "access_token" module_out_path = part_name + "/" + part_name sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" include_dirs = [ "${access_token_path}/frameworks/privacy/include", "${access_token_path}/frameworks/common/include", "${access_token_path}/services/common/ability_manager/include", "${access_token_path}/services/common/app_manager/include", "${access_token_path}/services/privacymanager/src/camera_manager", ] sources = [ "unittest/interface_code_test.cpp" ] cflags_cc = [] configs = [ "${access_token_path}/config:coverage_flags" ] deps = [ "${access_token_path}/frameworks/common:accesstoken_common_cxx", "${access_token_path}/frameworks/privacy:privacy_communication_adapter_cxx", "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk", "${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk", "${access_token_path}/interfaces/innerkits/privacy:libprivacy_sdk", "${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared", "${access_token_path}/services/common:accesstoken_service_common", "${access_token_path}/services/privacymanager:privacy_manager_service", ] external_deps = [ "ability_base:want", "access_token:libaccesstoken_sdk", "c_utils:utils", "googletest:gtest_main", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", "sqlite:sqlite", ] if (audio_framework_enable) { cflags_cc += [ "-DAUDIO_FRAMEWORK_ENABLE" ] external_deps += [ "audio_framework:audio_client" ] } if (ability_runtime_enable) { cflags_cc += [ "-DABILITY_RUNTIME_ENABLE" ] external_deps += [ "ability_runtime:ability_manager", "ability_runtime:app_manager", ] } if (camera_framework_enable) { cflags_cc += [ "-DCAMERA_FRAMEWORK_ENABLE" ] external_deps += [ "camera_framework:camera_framework" ] } } } group("unittest") { testonly = true deps = [ ":libipc_code_test" ] }