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_dualfw_restore_unittest" ]
21}
22
23ohos_unittest("ringtone_dualfw_restore_unittest") {
24  module_out_path = "ringtone_library/ringtonelibraryextention"
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/dualfw_conf_parser.cpp",
37    "${RINGTONE_RESTORE_PATH}/src/dualfw_sound_setting.cpp",
38    "${RINGTONE_RESTORE_PATH}/src/native_module_ohos_ringtone_restore.cpp",
39    "${RINGTONE_RESTORE_PATH}/src/ringtone_dualfw_restore.cpp",
40    "${RINGTONE_RESTORE_PATH}/src/ringtone_rdb_transaction.cpp",
41    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore.cpp",
42    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_base.cpp",
43    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_db_utils.cpp",
44    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_factory.cpp",
45    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_napi.cpp",
46    "../ringtone_unittest_utils/src/ringtone_unittest_utils.cpp",
47    "./src/ringtone_dualfw_restore_test.cpp",
48  ]
49
50  configs = [ "//build/config/compiler:exceptions" ]
51
52  deps = [
53    "${RINGTONE_ROOT_PATH}/services:ringtone_data_extension",
54    "${RINGTONE_ROOT_PATH}/services:ringtone_setting",
55    "${RINGTONE_ROOT_PATH}/services:ringtone_utils",
56    "${RINGTONE_ROOT_PATH}/services:ringtonerestore",
57  ]
58
59  external_deps = [
60    "ability_base:zuri",
61    "ability_runtime:ability_context_native",
62    "ability_runtime:ability_manager",
63    "ability_runtime:app_context",
64    "ability_runtime:app_manager",
65    "ability_runtime:extensionkit_native",
66    "ability_runtime:runtime",
67    "access_token:libaccesstoken_sdk",
68    "access_token:libnativetoken",
69    "access_token:libtoken_setproc",
70    "bundle_framework:appexecfwk_core",
71    "c_utils:utils",
72    "data_share:datashare_common",
73    "data_share:datashare_consumer",
74    "data_share:datashare_provider",
75    "hilog:libhilog",
76    "init:libbegetutil",
77    "ipc:ipc_single",
78    "libxml2:libxml2",
79    "media_library:media_library",
80    "napi:ace_napi",
81    "relational_store:native_rdb",
82    "relational_store:rdb_data_share_adapter",
83    "samgr:samgr_proxy",
84  ]
85
86  sanitize = {
87    cfi = true
88    cfi_cross_dso = true
89    debug = false
90  }
91
92  resource_config_file =
93      "${RINGTONE_ROOT_PATH}/test/unittest/resources/ohos_test.xml"
94
95  if (is_standard_system) {
96    external_deps += [ "hilog:libhilog" ]
97  } else {
98    external_deps += [ "hilog:libhilog" ]
99  }
100}
101