• 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/filemanagement/app_file_service/backup.gni")
16
17ohos_unittest("bms_adapter_test") {
18  module_out_path = path_module_out_tests
19
20  include_dirs = [
21    "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl",
22    "${path_backup}/services/backup_sa/include",
23    "${path_backup}/utils/include",
24    "${path_backup}/utils/include/b_hilog",
25    "${path_backup_mock}/utils_mock/include",
26  ]
27
28  sources = [
29    "${path_backup_mock}/utils_mock/src/b_jsonutil_mock.cpp",
30    "${path_backup_mock}/utils_mock/src/b_sa_utils_mock.cpp",
31    "bms_adapter_test.cpp",
32  ]
33
34  deps = [
35    "${path_backup}/interfaces/inner_api/native/backup_kit_inner:backup_kit_inner",
36    "${path_backup}/services/backup_sa:backup_sa",
37  ]
38
39  defines = [
40    "LOG_TAG=\"app_file_service\"",
41    "LOG_DOMAIN=0xD200000",
42    "private = public",
43    "protected = public",
44  ]
45
46  external_deps = [
47    "bundle_framework:appexecfwk_base",
48    "bundle_framework:appexecfwk_core",
49    "c_utils:utils",
50    "googletest:gmock_main",
51    "googletest:gtest_main",
52    "hilog:libhilog",
53    "hitrace:hitrace_meter",
54    "ipc:ipc_core",
55    "jsoncpp:jsoncpp",
56    "safwk:system_ability_fwk",
57    "samgr:dynamic_cache",
58    "samgr:samgr_proxy",
59    "storage_service:storage_manager_sa_proxy",
60  ]
61
62  use_exceptions = true
63}
64
65ohos_unittest("storage_manager_service_test") {
66  module_out_path = path_module_out_tests
67
68  include_dirs = [
69    "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl",
70    "${path_backup}/services/backup_sa/include",
71    "${path_backup}/services/backup_sa/src",
72    "${path_backup}/utils/include",
73    "${path_backup}/utils/include/b_hilog",
74    "${path_backup_mock}/utils_mock/include",
75  ]
76
77  sources = [
78    "${path_backup_mock}/utils_mock/src/b_jsonutil_mock.cpp",
79    "${path_backup_mock}/utils_mock/src/b_sa_utils_mock.cpp",
80    "storage_manager_service_test.cpp",
81  ]
82
83  deps = [
84    "${path_backup}/interfaces/inner_api/native/backup_kit_inner:backup_kit_inner",
85    "${path_backup}/utils:backup_utils",
86    "${path_backup}/interfaces/innerkits/native:sandbox_helper_native",
87    "${path_backup}/interfaces/innerkits/native:fileuri_native",
88    "${path_backup}/services/backup_sa:backup_sa"
89  ]
90
91  defines = [
92    "LOG_TAG=\"app_file_service\"",
93    "LOG_DOMAIN=0xD200000",
94    "private = public",
95    "protected = public",
96  ]
97
98  external_deps = [
99    "ability_base:want",
100    "ability_runtime:ability_connect_callback_stub",
101    "ability_runtime:ability_manager",
102    "access_token:libaccesstoken_sdk",
103    "access_token:libtokenid_sdk",
104    "bundle_framework:appexecfwk_base",
105    "bundle_framework:appexecfwk_core",
106    "c_utils:utils",
107    "common_event_service:cesfwk_innerkits",
108    "hilog:libhilog",
109    "hisysevent:libhisysevent",
110    "hitrace:hitrace_meter",
111    "init:libbegetutil",
112    "ipc:ipc_core",
113    "jsoncpp:jsoncpp",
114    "safwk:system_ability_fwk",
115    "samgr:samgr_proxy",
116    "storage_service:storage_manager_sa_proxy",
117    "data_share:datashare_consumer",
118    "data_share:datashare_common",
119    "googletest:gmock_main",
120    "googletest:gtest_main",
121  ]
122
123  use_exceptions = true
124}
125
126group("adapter_test") {
127  testonly = true
128  deps = [
129    ":bms_adapter_test",
130    ":storage_manager_service_test" ]
131}
132