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