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_restore_unittest" ] 21} 22 23ohos_unittest("ringtone_restore_unittest") { 24 module_out_path = "ringtone_library/ringtone_library" 25 26 include_dirs = [ 27 "./include", 28 "../ringtone_unittest_utils/include", 29 "${RINGTONE_RESTORE_PATH}/include", 30 "${RINGTONE_UTILS_PATH}/include", 31 "${RINGTONE_SETTING_PATH}/include", 32 "${RINGTONE_INTERFACES_PATH}/inner_api/native", 33 ] 34 35 sources = [ 36 "${RINGTONE_RESTORE_PATH}/src/customised_tone_processor.cpp", 37 "${RINGTONE_RESTORE_PATH}/src/dualfwk_conf_loader.cpp", 38 "${RINGTONE_RESTORE_PATH}/src/dualfwk_conf_parser.cpp", 39 "${RINGTONE_RESTORE_PATH}/src/dualfwk_sound_setting.cpp", 40 "${RINGTONE_RESTORE_PATH}/src/native_module_ohos_ringtone_restore.cpp", 41 "${RINGTONE_RESTORE_PATH}/src/ringtone_dualfwk_restore.cpp", 42 "${RINGTONE_RESTORE_PATH}/src/ringtone_rdb_transaction.cpp", 43 "${RINGTONE_RESTORE_PATH}/src/ringtone_restore.cpp", 44 "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_base.cpp", 45 "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_db_utils.cpp", 46 "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_factory.cpp", 47 "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_napi.cpp", 48 "../ringtone_unittest_utils/src/ringtone_unittest_utils.cpp", 49 "./src/ringtone_restore_test.cpp", 50 "./src/ringtone_source.cpp", 51 ] 52 53 configs = [ "//build/config/compiler:exceptions" ] 54 55 deps = [ 56 "${RINGTONE_ROOT_PATH}/services:ringtone_data_extension", 57 "${RINGTONE_ROOT_PATH}/services:ringtone_setting", 58 "${RINGTONE_ROOT_PATH}/services:ringtone_utils", 59 "${RINGTONE_ROOT_PATH}/services:ringtonerestore", 60 ] 61 62 external_deps = [ 63 "ability_base:zuri", 64 "ability_runtime:ability_context_native", 65 "ability_runtime:ability_manager", 66 "ability_runtime:abilitykit_native", 67 "ability_runtime:app_context", 68 "ability_runtime:app_manager", 69 "ability_runtime:extensionkit_native", 70 "ability_runtime:runtime", 71 "access_token:libaccesstoken_sdk", 72 "access_token:libnativetoken_shared", 73 "access_token:libtoken_setproc", 74 "bundle_framework:appexecfwk_core", 75 "c_utils:utils", 76 "common_event_service:cesfwk_innerkits", 77 "data_share:datashare_common", 78 "data_share:datashare_consumer", 79 "data_share:datashare_provider", 80 "hitrace:hitrace_meter", 81 "init:libbegetutil", 82 "ipc:ipc_napi", 83 "ipc:ipc_single", 84 "libxml2:libxml2", 85 "napi:ace_napi", 86 "os_account:os_account_innerkits", 87 "player_framework:media_client", 88 "preferences:native_preferences", 89 "relational_store:native_rdb", 90 "relational_store:rdb_data_share_adapter", 91 "samgr:samgr_proxy", 92 ] 93 94 sanitize = { 95 cfi = true 96 cfi_cross_dso = true 97 debug = false 98 } 99 100 resource_config_file = 101 "${RINGTONE_ROOT_PATH}/test/unittest/resources/ohos_test.xml" 102 103 if (is_standard_system) { 104 external_deps += [ "hilog:libhilog" ] 105 } else { 106 external_deps += [ "hilog:libhilog" ] 107 } 108} 109