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