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/test/common/help_utils.cpp", 51 "$ROOT_DIR/volume/src/external_volume_info.cpp", 52 "$ROOT_DIR/volume/src/process.cpp", 53 "$ROOT_DIR/volume/src/volume_info.cpp", 54 "$ROOT_DIR/volume/src/volume_manager.cpp", 55 ] 56 57 deps = [ 58 "$ROOT_DIR/crypto:libsdcrypto", 59 "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils", 60 "//third_party/googletest:gtest_main", 61 ] 62 63 external_deps = [ 64 "ability_base:base", 65 "ability_base:want", 66 "ability_base:zuri", 67 "access_token:libaccesstoken_sdk", 68 "app_file_service:fileshare_native", 69 "c_utils:utils", 70 "hiviewdfx_hilog_native:libhilog", 71 "init:libbegetutil", 72 "ipc:ipc_core", 73 "samgr:samgr_proxy", 74 ] 75} 76 77ohos_unittest("storage_daemon_proxy_test") { 78 module_out_path = "filemanagement/storage_service/storage_daemon" 79 80 defines = [ 81 "STORAGE_LOG_TAG = \"StorageDaemon\"", 82 "LOG_DOMAIN = 0xD004301", 83 ] 84 85 include_dirs = [ 86 "$ROOT_DIR/include", 87 "//foundation/filemanagement/storage_service/services/common/include", 88 "//foundation/communication/ipc/interfaces/innerkits/libdbinder/include", 89 ] 90 91 sources = [ 92 "$ROOT_DIR/ipc/src/storage_daemon_proxy.cpp", 93 "$ROOT_DIR/ipc/test/storage_daemon_proxy_test.cpp", 94 ] 95 96 deps = [ 97 "//third_party/googletest:gmock_main", 98 "//third_party/googletest:gtest_main", 99 ] 100 101 external_deps = [ 102 "c_utils:utils", 103 "hiviewdfx_hilog_native:libhilog", 104 "ipc:ipc_core", 105 "safwk:system_ability_fwk", 106 "samgr:samgr_proxy", 107 ] 108} 109 110ohos_unittest("storage_daemon_stub_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/include", 120 "$ROOT_DIR/ipc/test/", 121 "//foundation/filemanagement/storage_service/services/common/include", 122 "//base/security/huks/interfaces/innerkits/huks_standard/main/include", 123 "//foundation/communication/ipc/interfaces/innerkits/libdbinder/include", 124 "//base/security/access_token/interfaces/innerkits/accesstoken/include", 125 ] 126 127 sources = [ 128 "$ROOT_DIR/ipc/src/storage_daemon_proxy.cpp", 129 "$ROOT_DIR/ipc/src/storage_daemon_stub.cpp", 130 "$ROOT_DIR/ipc/test/storage_daemon_stub_test.cpp", 131 "$ROOT_DIR/user/src/user_manager.cpp", 132 "$ROOT_DIR/utils/mount_argument_utils.cpp", 133 ] 134 135 deps = [ 136 "//foundation/filemanagement/storage_service/services/storage_daemon:storage_common_utils", 137 "//third_party/googletest:gmock_main", 138 "//third_party/googletest:gtest_main", 139 ] 140 141 external_deps = [ 142 "access_token:libaccesstoken_sdk", 143 "c_utils:utils", 144 "hiviewdfx_hilog_native:libhilog", 145 "init:libbegetutil", 146 "ipc:ipc_core", 147 "safwk:system_ability_fwk", 148 "samgr:samgr_proxy", 149 ] 150} 151 152group("storage_daemon_ipc_test") { 153 testonly = true 154 deps = [ 155 ":storage_daemon_proxy_test", 156 ":storage_daemon_stub_test", 157 ":storage_daemon_test", 158 ] 159} 160