• 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"
17
18ohos_unittest("external_volume_info_test") {
19  module_out_path = "filemanagement/storage_service/storage_daemon"
20
21  defines = [ "STORAGE_LOG_TAG = \"StorageDaemon\"" ]
22
23  include_dirs = [
24    "$ROOT_DIR/storage_daemon/include",
25    "$ROOT_DIR/common/include",
26    "$ROOT_DIR/storage_manager/include",
27  ]
28
29  sources = [
30    "$ROOT_DIR/storage_daemon/volume/src/external_volume_info.cpp",
31    "$ROOT_DIR/storage_daemon/volume/src/process.cpp",
32    "$ROOT_DIR/storage_daemon/volume/src/volume_info.cpp",
33    "$ROOT_DIR/storage_daemon/volume/test/external_volume_info_test.cpp",
34  ]
35
36  deps = [
37    "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils",
38    "//third_party/googletest:gmock_main",
39    "//third_party/googletest:gtest_main",
40  ]
41
42  external_deps = [
43    "c_utils:utils",
44    "hiviewdfx_hilog_native:libhilog",
45    "init:libbegetutil",
46    "ipc:ipc_core",
47  ]
48}
49
50ohos_unittest("process_test") {
51  module_out_path = "filemanagement/storage_service/storage_daemon"
52
53  defines = [ "STORAGE_LOG_TAG = \"StorageDaemon\"" ]
54
55  include_dirs = [
56    "$ROOT_DIR/storage_daemon/include",
57    "$ROOT_DIR/storage_daemon/include/volume",
58    "$ROOT_DIR/common/include",
59  ]
60
61  sources = [
62    "$ROOT_DIR/storage_daemon/volume/src/external_volume_info.cpp",
63    "$ROOT_DIR/storage_daemon/volume/src/process.cpp",
64    "$ROOT_DIR/storage_daemon/volume/src/volume_info.cpp",
65    "$ROOT_DIR/storage_daemon/volume/test/process_test.cpp",
66  ]
67
68  deps = [
69    "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils",
70    "//third_party/googletest:gmock_main",
71    "//third_party/googletest:gtest_main",
72  ]
73
74  external_deps = [
75    "c_utils:utils",
76    "hiviewdfx_hilog_native:libhilog",
77    "init:libbegetutil",
78    "ipc:ipc_core",
79  ]
80}
81
82ohos_unittest("volume_info_test") {
83  module_out_path = "filemanagement/storage_service/storage_daemon"
84
85  defines = [ "STORAGE_LOG_TAG = \"StorageDaemon\"" ]
86
87  include_dirs = [
88    "$ROOT_DIR/storage_daemon/include",
89    "$ROOT_DIR/storage_daemon/utils/test/common",
90    "$ROOT_DIR/common/include",
91    "$ROOT_DIR/storage_manager/include",
92  ]
93
94  sources = [
95    "$ROOT_DIR/storage_daemon/utils/test/common/help_utils.cpp",
96    "$ROOT_DIR/storage_daemon/volume/src/volume_info.cpp",
97    "$ROOT_DIR/storage_daemon/volume/test/volume_info_test.cpp",
98  ]
99
100  deps = [
101    "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils",
102    "//third_party/googletest:gmock_main",
103    "//third_party/googletest:gtest_main",
104  ]
105
106  external_deps = [
107    "c_utils:utils",
108    "hiviewdfx_hilog_native:libhilog",
109    "init:libbegetutil",
110    "ipc:ipc_core",
111  ]
112}
113
114ohos_unittest("volume_manager_test") {
115  module_out_path = "filemanagement/storage_service/storage_daemon"
116
117  defines = [ "STORAGE_LOG_TAG = \"StorageDaemon\"" ]
118
119  include_dirs = [
120    "$ROOT_DIR/storage_daemon/include",
121    "$ROOT_DIR/storage_daemon/include/volume",
122    "$ROOT_DIR/common/include",
123    "$ROOT_DIR/storage_manager/include",
124    "//foundation/filemanagement/storage_service/interfaces/innerkits/storage_manager/native",
125    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
126  ]
127
128  sources = [
129    "$ROOT_DIR/storage_daemon/ipc/src/storage_manager_client.cpp",
130    "$ROOT_DIR/storage_daemon/volume/src/external_volume_info.cpp",
131    "$ROOT_DIR/storage_daemon/volume/src/process.cpp",
132    "$ROOT_DIR/storage_daemon/volume/src/volume_info.cpp",
133    "$ROOT_DIR/storage_daemon/volume/src/volume_manager.cpp",
134    "$ROOT_DIR/storage_daemon/volume/test/volume_manager_test.cpp",
135    "$ROOT_DIR/storage_manager/innerkits_impl/src/volume_core.cpp",
136  ]
137
138  deps = [
139    "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils",
140    "//third_party/googletest:gmock_main",
141    "//third_party/googletest:gtest_main",
142  ]
143
144  external_deps = [
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_volume_test") {
155  testonly = true
156  deps = [
157    ":external_volume_info_test",
158    ":process_test",
159    ":volume_info_test",
160    ":volume_manager_test",
161  ]
162}
163