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_data_extension_unittest" ]
21}
22
23ohos_unittest("ringtone_data_extension_unittest") {
24  module_out_path = "ringtone_library/ringtonelibraryextention"
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    "../get_self_permissions/include",
32  ]
33
34  sources = [
35    "../get_self_permissions/src/get_self_permissions.cpp",
36    "./src/ringtone_bundle_manager_test.cpp",
37    "./src/ringtone_data_manager_test.cpp",
38    "./src/ringtone_datashare_extension_test.cpp",
39    "./src/ringtone_datashare_stub_impl_test.cpp",
40    "./src/ringtone_language_manager_test.cpp",
41    "./src/ringtone_rdbstore_test.cpp",
42    "./src/ringtone_subscriber_test.cpp",
43  ]
44
45  deps = [
46    "${RINGTONE_ROOT_PATH}/services:ringtone_data_extension",
47    "${RINGTONE_ROOT_PATH}/services:ringtone_utils",
48    "${RINGTONE_ROOT_PATH}/services/ringtone_helper:ringtone_data_helper",
49  ]
50
51  external_deps = [
52    "ability_base:want",
53    "ability_base:zuri",
54    "ability_runtime:ability_context_native",
55    "ability_runtime:ability_manager",
56    "ability_runtime:abilitykit_native",
57    "ability_runtime:app_context",
58    "ability_runtime:appkit_native",
59    "access_token:libaccesstoken_sdk",
60    "access_token:libnativetoken",
61    "access_token:libprivacy_sdk",
62    "access_token:libtoken_setproc",
63    "bundle_framework:appexecfwk_base",
64    "bundle_framework:appexecfwk_core",
65    "c_utils:utils",
66    "common_event_service:cesfwk_innerkits",
67    "data_share:datashare_common",
68    "data_share:datashare_consumer",
69    "data_share:datashare_provider",
70    "ipc:ipc_single",
71    "napi:ace_napi",
72    "relational_store:native_rdb",
73    "relational_store:rdb_data_share_adapter",
74  ]
75
76  sanitize = {
77    cfi = true
78    cfi_cross_dso = true
79    debug = false
80  }
81
82  if (is_standard_system) {
83    external_deps += [ "hilog:libhilog" ]
84  } else {
85    external_deps += [ "hilog:libhilog" ]
86  }
87}
88