1# Copyright (c) 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") 16import("//foundation/ability/ability_runtime/ability_runtime.gni") 17 18module_output_path = "ability_runtime/ability_runtime/uripermmgr" 19config("coverage_flags") { 20 if (ability_runtime_feature_coverage) { 21 cflags = [ "--coverage" ] 22 ldflags = [ "--coverage" ] 23 } 24} 25 26ohos_unittest("file_permission_manager_test") { 27 module_out_path = module_output_path 28 sanitize = { 29 cfi = true 30 cfi_cross_dso = true 31 debug = false 32 blocklist = "../../cfi_blocklist.txt" 33 } 34 branch_protector_ret = "pac_ret" 35 include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper" ] 36 37 sources = [ "file_permission_manager_test.cpp" ] 38 39 configs = [ 40 ":coverage_flags", 41 "${ability_runtime_innerkits_path}/app_manager:appmgr_sdk_config", 42 ] 43 cflags = [] 44 if (target_cpu == "arm") { 45 cflags += [ "-DBINDER_IPC_32BIT" ] 46 } 47 deps = [ 48 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 49 "${ability_runtime_native_path}/appkit:appkit_manager_helper", 50 "${ability_runtime_services_path}/common:event_report", 51 "${ability_runtime_services_path}/uripermmgr:libupms_static", 52 ] 53 54 external_deps = [ 55 "ability_base:base", 56 "ability_base:want", 57 "bundle_framework:appexecfwk_base", 58 "c_utils:utils", 59 "eventhandler:libeventhandler", 60 "googletest:gtest_main", 61 "hilog:libhilog", 62 "hisysevent:libhisysevent", 63 "init:libbegetutil", 64 "ipc:ipc_core", 65 "napi:ace_napi", 66 ] 67 if (background_task_mgr_continuous_task_enable) { 68 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 69 } 70 if (ability_runtime_feature_sandboxmanager) { 71 external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ] 72 defines = [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ] 73 } 74} 75 76group("unittest") { 77 testonly = true 78 79 deps = [ ":file_permission_manager_test" ] 80} 81