1fc0b0055Sopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd. 2fc0b0055Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3fc0b0055Sopenharmony_ci# you may not use this file except in compliance with the License. 4fc0b0055Sopenharmony_ci# You may obtain a copy of the License at 5fc0b0055Sopenharmony_ci# 6fc0b0055Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7fc0b0055Sopenharmony_ci# 8fc0b0055Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9fc0b0055Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10fc0b0055Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11fc0b0055Sopenharmony_ci# See the License for the specific language governing permissions and 12fc0b0055Sopenharmony_ci# limitations under the License. 13fc0b0055Sopenharmony_ci 14fc0b0055Sopenharmony_ciimport("//build/test.gni") 15fc0b0055Sopenharmony_ciimport("../../../access_token.gni") 16fc0b0055Sopenharmony_ci 17fc0b0055Sopenharmony_ciif (is_standard_system && ability_base_enable) { 18fc0b0055Sopenharmony_ci ohos_unittest("libipc_code_test") { 19fc0b0055Sopenharmony_ci subsystem_name = "security" 20fc0b0055Sopenharmony_ci part_name = "access_token" 21fc0b0055Sopenharmony_ci module_out_path = part_name + "/" + part_name 22fc0b0055Sopenharmony_ci sanitize = { 23fc0b0055Sopenharmony_ci cfi = true 24fc0b0055Sopenharmony_ci cfi_cross_dso = true 25fc0b0055Sopenharmony_ci debug = false 26fc0b0055Sopenharmony_ci } 27fc0b0055Sopenharmony_ci branch_protector_ret = "pac_ret" 28fc0b0055Sopenharmony_ci 29fc0b0055Sopenharmony_ci include_dirs = [ 30fc0b0055Sopenharmony_ci "${access_token_path}/frameworks/privacy/include", 31fc0b0055Sopenharmony_ci "${access_token_path}/frameworks/common/include", 32fc0b0055Sopenharmony_ci "${access_token_path}/services/common/ability_manager/include", 33fc0b0055Sopenharmony_ci "${access_token_path}/services/common/app_manager/include", 34fc0b0055Sopenharmony_ci "${access_token_path}/services/privacymanager/src/camera_manager", 35fc0b0055Sopenharmony_ci ] 36fc0b0055Sopenharmony_ci 37fc0b0055Sopenharmony_ci sources = [ "unittest/interface_code_test.cpp" ] 38fc0b0055Sopenharmony_ci 39fc0b0055Sopenharmony_ci cflags_cc = [] 40fc0b0055Sopenharmony_ci 41fc0b0055Sopenharmony_ci configs = [ "${access_token_path}/config:coverage_flags" ] 42fc0b0055Sopenharmony_ci 43fc0b0055Sopenharmony_ci deps = [ 44fc0b0055Sopenharmony_ci "${access_token_path}/frameworks/common:accesstoken_common_cxx", 45fc0b0055Sopenharmony_ci "${access_token_path}/frameworks/inner_api/privacy:libprivacy_sdk", 46fc0b0055Sopenharmony_ci "${access_token_path}/frameworks/privacy:privacy_communication_adapter_cxx", 47fc0b0055Sopenharmony_ci "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk", 48fc0b0055Sopenharmony_ci "${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk", 49fc0b0055Sopenharmony_ci "${access_token_path}/interfaces/innerkits/token_setproc:libtokensetproc_shared", 50fc0b0055Sopenharmony_ci "${access_token_path}/services/common:accesstoken_service_common", 51fc0b0055Sopenharmony_ci "${access_token_path}/services/privacymanager:privacy_manager_service", 52fc0b0055Sopenharmony_ci ] 53fc0b0055Sopenharmony_ci 54fc0b0055Sopenharmony_ci external_deps = [ 55fc0b0055Sopenharmony_ci "ability_base:want", 56fc0b0055Sopenharmony_ci "access_token:libaccesstoken_sdk", 57fc0b0055Sopenharmony_ci "c_utils:utils", 58fc0b0055Sopenharmony_ci "googletest:gtest_main", 59fc0b0055Sopenharmony_ci "hilog:libhilog", 60fc0b0055Sopenharmony_ci "init:libbegetutil", 61fc0b0055Sopenharmony_ci "ipc:ipc_core", 62fc0b0055Sopenharmony_ci "safwk:system_ability_fwk", 63fc0b0055Sopenharmony_ci "samgr:samgr_proxy", 64fc0b0055Sopenharmony_ci "sqlite:sqlite", 65fc0b0055Sopenharmony_ci ] 66fc0b0055Sopenharmony_ci 67fc0b0055Sopenharmony_ci if (audio_framework_enable) { 68fc0b0055Sopenharmony_ci cflags_cc += [ "-DAUDIO_FRAMEWORK_ENABLE" ] 69fc0b0055Sopenharmony_ci external_deps += [ "audio_framework:audio_client" ] 70fc0b0055Sopenharmony_ci } 71fc0b0055Sopenharmony_ci 72fc0b0055Sopenharmony_ci if (ability_runtime_enable) { 73fc0b0055Sopenharmony_ci cflags_cc += [ "-DABILITY_RUNTIME_ENABLE" ] 74fc0b0055Sopenharmony_ci external_deps += [ 75fc0b0055Sopenharmony_ci "ability_runtime:ability_manager", 76fc0b0055Sopenharmony_ci "ability_runtime:app_manager", 77fc0b0055Sopenharmony_ci ] 78fc0b0055Sopenharmony_ci } 79fc0b0055Sopenharmony_ci if (camera_framework_enable) { 80fc0b0055Sopenharmony_ci cflags_cc += [ "-DCAMERA_FRAMEWORK_ENABLE" ] 81fc0b0055Sopenharmony_ci external_deps += [ "camera_framework:camera_framework" ] 82fc0b0055Sopenharmony_ci } 83fc0b0055Sopenharmony_ci } 84fc0b0055Sopenharmony_ci} 85fc0b0055Sopenharmony_ci 86fc0b0055Sopenharmony_cigroup("unittest") { 87fc0b0055Sopenharmony_ci testonly = true 88fc0b0055Sopenharmony_ci deps = [ ":libipc_code_test" ] 89fc0b0055Sopenharmony_ci} 90