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/test.gni") 15import("//foundation/multimedia/ringtone_library/ringtone_library.gni") 16 17group("unittest") { 18 testonly = true 19 20 deps = [ ":ringtone_utils_unittest" ] 21} 22 23ohos_unittest("ringtone_utils_unittest") { 24 module_out_path = "ringtone_library/ringtone_library" 25 26 include_dirs = [ 27 "./include", 28 "${RINGTONE_EXTENSION_PATH}/include", 29 "${RINGTONE_SERVICES_PATH}/utils/include", 30 "${RINGTONE_INTERFACES_PATH}/inner_api/native", 31 "${RINGTONE_SCANNER_PATH}/include", 32 "${RINGTONE_RESTORE_PATH}/include", 33 "${RINGTONE_UTILS_PATH}/include", 34 ] 35 36 sources = [ 37 "${RINGTONE_SERVICES_PATH}/utils/src/permission_utils.cpp", 38 "./src/ringtone_file_utils_test.cpp", 39 "./src/ringtone_mimetype_utils_test.cpp", 40 "./src/ringtone_permission_utils_test.cpp", 41 "./src/ringtone_privacy_manager_test.cpp", 42 ] 43 44 deps = [ 45 "${RINGTONE_ROOT_PATH}/services:ringtone_data_extension", 46 "${RINGTONE_ROOT_PATH}/services:ringtone_utils", 47 ] 48 49 external_deps = [ 50 "ability_base:want", 51 "ability_base:zuri", 52 "ability_runtime:ability_context_native", 53 "ability_runtime:ability_manager", 54 "ability_runtime:app_context", 55 "access_token:libaccesstoken_sdk", 56 "access_token:libnativetoken_shared", 57 "access_token:libprivacy_sdk", 58 "access_token:libtokenid_sdk", 59 "access_token:libtokensetproc_shared", 60 "bundle_framework:appexecfwk_core", 61 "c_utils:utils", 62 "data_share:datashare_common", 63 "hitrace:hitrace_meter", 64 "ipc:ipc_core", 65 "ipc:ipc_single", 66 "napi:ace_napi", 67 "os_account:os_account_innerkits", 68 "relational_store:native_rdb", 69 "safwk:system_ability_fwk", 70 "samgr:samgr_proxy", 71 ] 72 73 sanitize = { 74 cfi = true 75 cfi_cross_dso = true 76 debug = false 77 } 78 79 if (is_standard_system) { 80 external_deps += [ "hilog:libhilog" ] 81 } else { 82 external_deps += [ "hilog:libhilog" ] 83 } 84 85 cflags = [ 86 "-Wall", 87 "-Werror", 88 "-fno-access-control", 89 ] 90} 91