# Copyright (c) 2022 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/ohos.gni") import("//build/test.gni") import("//foundation/resourceschedule/background_task_mgr/bgtaskmgr.gni") module_output_path = "background_task_mgr/unittest" ohos_unittest("bgtask_framework_unit_test") { module_out_path = module_output_path cflags_cc = [ "-Dprivate=public", "-Dprotected=public", ] include_dirs = [ "${bgtaskmgr_interfaces_path}/innerkits/include", "mock/include", ] sources = [ "${bgtaskmgr_frameworks_path}/src/expired_callback_proxy.cpp", "bgtask_framework_unit_test.cpp", "mock/src/mock_service_registry.cpp", ] deps = [ "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_runtime:wantagent_innerkits", "c_utils:utils", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] subsystem_name = "resourceschedule" part_name = "background_task_mgr" } ohos_unittest("bgtask_framework_abnormal_unit_test") { module_out_path = module_output_path cflags_cc = [ "-Dprivate=public", "-Dprotected=public", ] include_dirs = [ "${bgtaskmgr_interfaces_path}/innerkits/include", "mock/include", ] sources = [ "${bgtaskmgr_frameworks_path}/src/expired_callback_proxy.cpp", "bgtask_framework_abnormal_unit_test.cpp", "mock/parcel_abnormal/src/mock_message_parcel.cpp", "mock/src/mock_background_task_mgr_proxy.cpp", ] deps = [ "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_runtime:wantagent_innerkits", "c_utils:utils", "common_event_service:cesfwk_innerkits", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] subsystem_name = "resourceschedule" part_name = "background_task_mgr" } group("unittest") { testonly = true deps = [ ":bgtask_framework_abnormal_unit_test", ":bgtask_framework_unit_test", ] }