# Copyright (C) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("//foundation/filemanagement/dfs_service/distributedfile.gni") module_output_path = "storage_distributed_file_manager/distributedfiledaemon" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${distributedfile_path}/frameworks/native/distributed_file_inner/include/asset", "${distributedfile_path}/test/mock", "${services_path}/distributedfiledaemon/include", "${services_path}/distributedfiledaemon/include/ipc", "//third_party/json/include", ] } ohos_unittest("asset_callback_manager_test") { branch_protector_ret = "pac_ret" sanitize = { integer_overflow = true cfi = true cfi_cross_dso = true debug = false blocklist = "${distributedfile_path}/cfi_blocklist.txt" } module_out_path = module_output_path sources = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp", "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp", "asset_callback_manager_test.cpp", ] configs = [ ":module_private_config", "${utils_path}:compiler_configs", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "dsoftbus:softbus_client", "hilog:libhilog", "ipc:ipc_core", "zlib:shared_libz", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true } ohos_unittest("asset_recv_callback_proxy_test") { branch_protector_ret = "pac_ret" sanitize = { integer_overflow = true cfi = true cfi_cross_dso = true debug = false blocklist = "${distributedfile_path}/cfi_blocklist.txt" } module_out_path = module_output_path sources = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp", "${distributedfile_path}/test/mock/message_parcel_mock.cpp", "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp", "asset_recv_callback_proxy_test.cpp", ] configs = [ ":module_private_config", "${utils_path}:compiler_configs", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "access_token:libaccesstoken_sdk", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] } ohos_unittest("asset_send_callback_proxy_test") { branch_protector_ret = "pac_ret" sanitize = { integer_overflow = true cfi = true cfi_cross_dso = true debug = false blocklist = "${distributedfile_path}/cfi_blocklist.txt" } module_out_path = module_output_path sources = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp", "${distributedfile_path}/test/mock/message_parcel_mock.cpp", "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp", "asset_send_callback_proxy_test.cpp", ] configs = [ ":module_private_config", "${utils_path}:compiler_configs", ] deps = [ "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "access_token:libaccesstoken_sdk", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] } group("unittest") { testonly = true deps = [ ":asset_callback_manager_test", ":asset_recv_callback_proxy_test", ":asset_send_callback_proxy_test", ] }