1# Copyright (c) 2021 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("disk_manager_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 include_dirs = [ 27 "$ROOT_DIR/include", 28 "//foundation/filemanagement/storage_service/utils/include", 29 "//foundation/filemanagement/storage_service/services/storage_manager/include", 30 "//foundation/filemanagement/storage_service/interfaces/innerkits/storage_manager/native", 31 "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk", 32 "//foundation/filemanagement/storage_service/services/common/include", 33 "//foundation/filemanagement/storage_service/services/storage_daemon/include", 34 ] 35 36 sources = [ 37 "$ROOT_DIR/disk/src/disk_config.cpp", 38 "$ROOT_DIR/disk/src/disk_info.cpp", 39 "$ROOT_DIR/disk/src/disk_manager.cpp", 40 "$ROOT_DIR/disk/test/disk_manager_test.cpp", 41 "$ROOT_DIR/ipc/src/storage_manager_client.cpp", 42 "$ROOT_DIR/netlink/src/netlink_data.cpp", 43 "$ROOT_DIR/utils/disk_utils.cpp", 44 "$ROOT_DIR/volume/src/external_volume_info.cpp", 45 "$ROOT_DIR/volume/src/process.cpp", 46 "$ROOT_DIR/volume/src/volume_info.cpp", 47 "$ROOT_DIR/volume/src/volume_manager.cpp", 48 ] 49 50 deps = [ 51 "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils", 52 "//third_party/googletest:gtest_main", 53 ] 54 55 external_deps = [ 56 "c_utils:utils", 57 "hiviewdfx_hilog_native:libhilog", 58 "init:libbegetutil", 59 "ipc:ipc_core", 60 "samgr:samgr_proxy", 61 "storage_service:storage_manager_sa_proxy", 62 ] 63} 64 65ohos_unittest("disk_info_test") { 66 module_out_path = "filemanagement/storage_service/storage_daemon" 67 68 defines = [ 69 "STORAGE_LOG_TAG = \"StorageDaemon\"", 70 "LOG_DOMAIN = 0xD004301", 71 ] 72 73 include_dirs = [ 74 "$ROOT_DIR/disk/test", 75 "$ROOT_DIR/include", 76 "//foundation/filemanagement/storage_service/utils/include", 77 "//foundation/filemanagement/storage_service/services/storage_manager/include", 78 "//foundation/filemanagement/storage_service/interfaces/innerkits/storage_manager/native", 79 "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk", 80 "//foundation/filemanagement/storage_service/services/common/include", 81 "//foundation/filemanagement/storage_service/services/storage_daemon/include", 82 ] 83 84 sources = [ 85 "$ROOT_DIR/disk/src/disk_info.cpp", 86 "$ROOT_DIR/disk/test/disk_info_test.cpp", 87 "$ROOT_DIR/ipc/src/storage_manager_client.cpp", 88 "$ROOT_DIR/netlink/src/netlink_data.cpp", 89 "$ROOT_DIR/utils/disk_utils.cpp", 90 "$ROOT_DIR/volume/src/external_volume_info.cpp", 91 "$ROOT_DIR/volume/src/process.cpp", 92 "$ROOT_DIR/volume/src/volume_info.cpp", 93 "$ROOT_DIR/volume/src/volume_manager.cpp", 94 ] 95 96 deps = [ 97 "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils", 98 "//third_party/googletest:gmock_main", 99 "//third_party/googletest:gtest_main", 100 ] 101 102 external_deps = [ 103 "c_utils:utils", 104 "hiviewdfx_hilog_native:libhilog", 105 "init:libbegetutil", 106 "ipc:ipc_core", 107 "samgr:samgr_proxy", 108 "storage_service:storage_manager_sa_proxy", 109 ] 110} 111 112ohos_unittest("disk_config_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/disk/test", 122 "$ROOT_DIR/include", 123 "//foundation/filemanagement/storage_service/utils/include", 124 "//foundation/filemanagement/storage_service/services/storage_manager/include", 125 "//foundation/filemanagement/storage_service/interfaces/innerkits/storage_manager/native", 126 "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk", 127 "//foundation/filemanagement/storage_service/services/common/include", 128 "//foundation/filemanagement/storage_service/services/storage_daemon/include", 129 ] 130 131 sources = [ 132 "$ROOT_DIR/disk/src/disk_config.cpp", 133 "$ROOT_DIR/disk/test/disk_config_test.cpp", 134 ] 135 136 deps = [ "//third_party/googletest:gmock_main" ] 137 138 external_deps = [ 139 "c_utils:utils", 140 "hiviewdfx_hilog_native:libhilog", 141 "ipc:ipc_core", 142 ] 143} 144 145group("storage_daemon_disk_test") { 146 testonly = true 147 deps = [ 148 ":disk_config_test", 149 ":disk_info_test", 150 ":disk_manager_test", 151 ] 152} 153