• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_dualfwk_restore_unittest" ]
21}
22
23ohos_unittest("ringtone_dualfwk_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/dualfwk_conf_loader.cpp",
37    "${RINGTONE_RESTORE_PATH}/src/dualfwk_conf_parser.cpp",
38    "${RINGTONE_RESTORE_PATH}/src/dualfwk_sound_setting.cpp",
39    "${RINGTONE_RESTORE_PATH}/src/native_module_ohos_ringtone_restore.cpp",
40    "${RINGTONE_RESTORE_PATH}/src/ringtone_dualfwk_restore.cpp",
41    "${RINGTONE_RESTORE_PATH}/src/ringtone_rdb_transaction.cpp",
42    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore.cpp",
43    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_base.cpp",
44    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_db_utils.cpp",
45    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_factory.cpp",
46    "${RINGTONE_RESTORE_PATH}/src/ringtone_restore_napi.cpp",
47    "../ringtone_unittest_utils/src/ringtone_unittest_utils.cpp",
48    "./src/ringtone_dualfwk_restore_test.cpp",
49  ]
50
51  configs = [ "//build/config/compiler:exceptions" ]
52
53  deps = [
54    "${RINGTONE_ROOT_PATH}/services:ringtone_data_extension",
55    "${RINGTONE_ROOT_PATH}/services:ringtone_setting",
56    "${RINGTONE_ROOT_PATH}/services:ringtone_utils",
57    "${RINGTONE_ROOT_PATH}/services:ringtonerestore",
58  ]
59
60  external_deps = [
61    "ability_base:zuri",
62    "ability_runtime:ability_context_native",
63    "ability_runtime:ability_manager",
64    "ability_runtime:app_context",
65    "ability_runtime:app_manager",
66    "ability_runtime:extensionkit_native",
67    "ability_runtime:runtime",
68    "access_token:libaccesstoken_sdk",
69    "access_token:libnativetoken",
70    "access_token:libtoken_setproc",
71    "bundle_framework:appexecfwk_core",
72    "c_utils:utils",
73    "data_share:datashare_common",
74    "data_share:datashare_consumer",
75    "data_share:datashare_provider",
76    "hilog:libhilog",
77    "init:libbegetutil",
78    "ipc:ipc_single",
79    "libxml2:libxml2",
80    "napi:ace_napi",
81    "os_account:os_account_innerkits",
82    "player_framework:media_client",
83    "preferences:native_preferences",
84    "relational_store:native_rdb",
85    "relational_store:rdb_data_share_adapter",
86    "samgr:samgr_proxy",
87  ]
88
89  if (ringtone_media_library_enable) {
90    defines = [ "USE_MEDIA_LIBRARY" ]
91    external_deps += [ "media_library:media_library" ]
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