# 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("//base/account/os_account/os_account.gni") import("//build/ohos.gni") import("//build/test.gni") module_output_path = "os_account/services/accountmgr" config("ability_manager_adapter_test_config") { include_dirs = [ "${common_path}/log/include", "${common_path}/account_error/include", "${services_path}/accountmgr/include", "${services_path}/accountmgr/include/ability_manager_adapter", "${ability_runtime_path}/interfaces/inner_api/ability_manager/include", ] } ohos_unittest("AbilityManagerAdapterTest") { module_out_path = module_output_path cflags_cc = [] sources = [ "${services_path}/accountmgr/src/ability_manager_adapter/ability_manager_adapter.cpp" ] sources += [ "ability_manager_adapter_test.cpp" ] configs = [ ":ability_manager_adapter_test_config", "${services_path}/accountmgr/test:accountmgr_test_config", ] deps = [ "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "c_utils:utils", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] part_name = "os_account" } ohos_unittest("AbilityManagerAdapterMockTest") { module_out_path = module_output_path cflags_cc = [] sources = [ "${services_path}/accountmgr/src/ability_manager_adapter/ability_manager_adapter.cpp", "//base/account/os_account/services/accountmgr/test/mock/src/mock_service_registry.cpp", ] sources += [ "ability_manager_adapter_mock_test.cpp" ] configs = [ ":ability_manager_adapter_test_config", "${services_path}/accountmgr/test:accountmgr_test_config", ] deps = [ "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "c_utils:utils", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] part_name = "os_account" } group("unittest") { testonly = true deps = [ ":AbilityManagerAdapterMockTest", ":AbilityManagerAdapterTest", ] }