• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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")
15
16ROOT_DIR = "//foundation/filemanagement/storage_service/services/storage_daemon"
17
18ohos_unittest("storage_daemon_test") {
19  module_out_path = "filemanagement/storage_service/storage_daemon"
20
21  defines = [
22    "STORAGE_LOG_TAG = \"StorageDaemon\"",
23    "LOG_DOMAIN = 0xD004301",
24  ]
25
26  cflags_cc = [ "-Wno-unused-const-variable" ]
27
28  include_dirs = [
29    "$ROOT_DIR/include",
30    "$ROOT_DIR/utils",
31    "$ROOT_DIR/../storage_manager/include",
32    "//foundation/filemanagement/storage_service/interfaces/innerkits/storage_manager/native",
33    "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk",
34    "//base/security/huks/interfaces/innerkits/huks_standard/main/include",
35    "//foundation/communication/ipc/interfaces/innerkits/libdbinder/include",
36    "//foundation/filemanagement/storage_service/services/common/include",
37    "//base/security/access_token/interfaces/innerkits/accesstoken/include",
38  ]
39
40  sources = [
41    "$ROOT_DIR/disk/src/disk_config.cpp",
42    "$ROOT_DIR/disk/src/disk_info.cpp",
43    "$ROOT_DIR/disk/src/disk_manager.cpp",
44    "$ROOT_DIR/ipc/src/storage_daemon.cpp",
45    "$ROOT_DIR/ipc/src/storage_daemon_stub.cpp",
46    "$ROOT_DIR/ipc/src/storage_manager_client.cpp",
47    "$ROOT_DIR/ipc/test/storage_daemon_test.cpp",
48    "$ROOT_DIR/user/src/mount_manager.cpp",
49    "$ROOT_DIR/user/src/user_manager.cpp",
50    "$ROOT_DIR/utils/disk_utils.cpp",
51    "$ROOT_DIR/utils/mount_argument_utils.cpp",
52    "$ROOT_DIR/utils/test/common/help_utils.cpp",
53    "$ROOT_DIR/volume/src/external_volume_info.cpp",
54    "$ROOT_DIR/volume/src/process.cpp",
55    "$ROOT_DIR/volume/src/volume_info.cpp",
56    "$ROOT_DIR/volume/src/volume_manager.cpp",
57  ]
58
59  deps = [
60    "$ROOT_DIR/crypto:libsdcrypto",
61    "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils",
62    "//third_party/googletest:gtest_main",
63  ]
64
65  external_deps = [
66    "ability_base:base",
67    "ability_base:want",
68    "ability_base:zuri",
69    "access_token:libaccesstoken_sdk",
70    "app_file_service:fileshare_native",
71    "c_utils:utils",
72    "hiviewdfx_hilog_native:libhilog",
73    "init:libbegetutil",
74    "ipc:ipc_core",
75    "samgr:samgr_proxy",
76  ]
77}
78
79ohos_unittest("storage_daemon_proxy_test") {
80  module_out_path = "filemanagement/storage_service/storage_daemon"
81
82  defines = [
83    "STORAGE_LOG_TAG = \"StorageDaemon\"",
84    "LOG_DOMAIN = 0xD004301",
85  ]
86
87  include_dirs = [
88    "$ROOT_DIR/include",
89    "//foundation/filemanagement/storage_service/services/common/include",
90    "//foundation/communication/ipc/interfaces/innerkits/libdbinder/include",
91  ]
92
93  sources = [
94    "$ROOT_DIR/ipc/src/storage_daemon_proxy.cpp",
95    "$ROOT_DIR/ipc/test/storage_daemon_proxy_test.cpp",
96  ]
97
98  deps = [
99    "//third_party/googletest:gmock_main",
100    "//third_party/googletest:gtest_main",
101  ]
102
103  external_deps = [
104    "c_utils:utils",
105    "hiviewdfx_hilog_native:libhilog",
106    "ipc:ipc_core",
107    "safwk:system_ability_fwk",
108    "samgr:samgr_proxy",
109  ]
110}
111
112ohos_unittest("storage_daemon_stub_test") {
113  module_out_path = "filemanagement/storage_service/storage_daemon"
114
115  defines = [
116    "STORAGE_LOG_TAG = \"StorageDaemon\"",
117    "LOG_DOMAIN = 0xD004301",
118  ]
119
120  include_dirs = [
121    "$ROOT_DIR/include",
122    "$ROOT_DIR/ipc/test/",
123    "//foundation/filemanagement/storage_service/services/common/include",
124    "//base/security/huks/interfaces/innerkits/huks_standard/main/include",
125    "//foundation/communication/ipc/interfaces/innerkits/libdbinder/include",
126    "//base/security/access_token/interfaces/innerkits/accesstoken/include",
127  ]
128
129  sources = [
130    "$ROOT_DIR/ipc/src/storage_daemon_proxy.cpp",
131    "$ROOT_DIR/ipc/src/storage_daemon_stub.cpp",
132    "$ROOT_DIR/ipc/test/storage_daemon_stub_test.cpp",
133    "$ROOT_DIR/user/src/user_manager.cpp",
134    "$ROOT_DIR/utils/mount_argument_utils.cpp",
135  ]
136
137  deps = [
138    "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils",
139    "//third_party/googletest:gmock_main",
140    "//third_party/googletest:gtest_main",
141  ]
142
143  external_deps = [
144    "access_token:libaccesstoken_sdk",
145    "c_utils:utils",
146    "hiviewdfx_hilog_native:libhilog",
147    "init:libbegetutil",
148    "ipc:ipc_core",
149    "safwk:system_ability_fwk",
150    "samgr:samgr_proxy",
151  ]
152}
153
154group("storage_daemon_ipc_test") {
155  testonly = true
156  deps = [
157    ":storage_daemon_proxy_test",
158    ":storage_daemon_stub_test",
159    ":storage_daemon_test",
160  ]
161}
162