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") 15import("//foundation/ability/ability_runtime/ability_runtime.gni") 16 17module_output_path = "ability_tools/tools" 18 19ability_delegator_mock_sources = 20 [ "${ability_runtime_path}/tools/test/mock/mock_ability_manager_stub.cpp" ] 21 22config("tools_ability_delegator_config") { 23 include_dirs = [ 24 "${ability_runtime_path}/tools/test/mock", 25 "//third_party/googletest/googlemock/include", 26 "${ability_runtime_path}/tools/aa/include", 27 ] 28} 29 30ohos_moduletest("ability_command_module_test") { 31 module_out_path = module_output_path 32 33 configs = [ ":tools_ability_delegator_config" ] 34 35 sources = [ "ability_command_module_test.cpp" ] 36 sources += ability_delegator_mock_sources 37 38 deps = [ 39 "${ability_runtime_path}/tools/aa:tools_aa_source_set", 40 "${ability_runtime_services_path}/abilitymgr:abilityms", 41 "//third_party/googletest:gmock_main", 42 "//third_party/googletest:gtest_main", 43 ] 44 45 external_deps = [ 46 "ability_base:configuration", 47 "bundle_framework:appexecfwk_base", 48 "hilog:libhilog", 49 "ipc:ipc_core", 50 ] 51} 52 53ohos_moduletest("test_observer_module_test") { 54 module_out_path = module_output_path 55 56 configs = [ ":tools_ability_delegator_config" ] 57 58 sources = [ "test_observer_module_test.cpp" ] 59 sources += ability_delegator_mock_sources 60 61 deps = [ 62 "${ability_runtime_path}/tools/aa:tools_aa_source_set", 63 "${ability_runtime_services_path}/abilitymgr:abilityms", 64 "//third_party/googletest:gmock_main", 65 "//third_party/googletest:gtest_main", 66 ] 67 68 external_deps = [ 69 "ability_base:configuration", 70 "bundle_framework:appexecfwk_base", 71 "hilog:libhilog", 72 "ipc:ipc_core", 73 ] 74} 75 76ohos_moduletest("shell_command_result_module_test") { 77 module_out_path = module_output_path 78 79 sources = [ "shell_command_result_module_test.cpp" ] 80 81 configs = [ ":tools_ability_delegator_config" ] 82 83 deps = [ 84 "${ability_runtime_path}/tools/aa:tools_aa_source_set", 85 "//third_party/googletest:gmock_main", 86 "//third_party/googletest:gtest_main", 87 ] 88 89 external_deps = [ 90 "ability_base:configuration", 91 "bundle_framework:appexecfwk_base", 92 "hilog:libhilog", 93 "ipc:ipc_core", 94 ] 95} 96 97group("moduletest") { 98 testonly = true 99 100 deps = [ 101 ":ability_command_module_test", 102 ":shell_command_result_module_test", 103 ":test_observer_module_test", 104 ] 105} 106