# Copyright (C) 2023 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/distributeddatamgr/pasteboard/pasteboard.gni") config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "${pasteboard_innerkits_path}/include", "${pasteboard_utils_path}/native/include", "${pasteboard_service_path}/dfx/src", "${pasteboard_service_path}/dfx/src/behaviour", "${pasteboard_service_path}/dfx/src/fault", "${pasteboard_service_path}/dfx/src/statistic", "${pasteboard_service_path}/core/include", "include", "unittest/include", "//base/security/access_token/interfaces/innerkits/accesstoken/include", "//foundation/distributeddatamgr/pasteboard/framework/tlv", "//foundation/distributeddatamgr/pasteboard/framework/uri", ] } module_output_path = "pasteboard/pasteboard_service" ohos_unittest("PasteboardServiceTest") { module_out_path = module_output_path sources = [ "${pasteboard_service_path}/dfx/src/behaviour/pasteboard_behaviour_reporter_impl.cpp", "${pasteboard_service_path}/dfx/src/fault/pasteboard_fault_impl.cpp", "${pasteboard_service_path}/dfx/src/reporter.cpp", "${pasteboard_service_path}/dfx/src/statistic/time_consuming_statistic_impl.cpp", "unittest/src/dfx_test.cpp", "unittest/src/paste_service_test.cpp", ] configs = [ "//commonlibrary/c_utils/base:utils_config", ":module_private_config", ] external_deps = [ "ability_base:want", "ability_base:zuri", "access_token:libaccesstoken_sdk", "c_utils:utils", "hilog:libhilog", "image_framework:image_native", "ipc:ipc_core", "os_account:os_account_innerkits", ] deps = [ "${pasteboard_innerkits_path}:pasteboard_client", "//base/security/access_token/interfaces/innerkits/token_setproc:libtoken_setproc", "//third_party/googletest:gtest_main", ] } ohos_unittest("PasteboardDialogNormalTest") { module_out_path = module_output_path sources = [ "${pasteboard_service_path}/core/src/pasteboard_dialog.cpp", "unittest/src/pasteboard_dialog_normal_branch_test.cpp", ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] deps = [ "//third_party/googletest:gtest_main" ] } ohos_unittest("PasteboardDialogAbnormalTest") { module_out_path = module_output_path sources = [ "${pasteboard_service_path}/core/src/pasteboard_dialog.cpp", "unittest/src/pasteboard_dialog_abnormal_branch_test.cpp", ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] deps = [ "//third_party/googletest:gtest_main" ] } ohos_unittest("PasteboardLinkedListTest") { module_out_path = module_output_path include_dirs = [ "${pasteboard_utils_path}/native/include" ] sources = [ "unittest/src/pasteboard_linked_list_test.cpp" ] external_deps = [ "googletest:gtest_main" ] } ohos_unittest("PasteboardDeduplicateMemoryTest") { module_out_path = module_output_path include_dirs = [ "${pasteboard_service_path}/dfx/src", "${pasteboard_utils_path}/native/include", ] sources = [ "unittest/src/pasteboard_deduplicate_memory_test.cpp" ] external_deps = [ "c_utils:utils", "googletest:gtest_main", "hilog:libhilog", ] } group("unittest") { testonly = true deps = [ ":PasteboardDeduplicateMemoryTest", ":PasteboardDialogAbnormalTest", ":PasteboardDialogNormalTest", ":PasteboardLinkedListTest", ":PasteboardServiceTest", ] }