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_unittest("ability_command_test") { 31 module_out_path = module_output_path 32 33 configs = [ ":tools_ability_delegator_config" ] 34 35 sources = [ "ability_command_test.cpp" ] 36 sources += ability_delegator_mock_sources 37 38 deps = [ 39 "${ability_runtime_path}/tools/aa:tools_aa_source_set", 40 "//third_party/googletest:gmock_main", 41 "//third_party/googletest:gtest_main", 42 ] 43 44 external_deps = [ 45 "ability_base:configuration", 46 "bundle_framework:appexecfwk_base", 47 "hiviewdfx_hilog_native:libhilog", 48 "ipc:ipc_core", 49 ] 50} 51 52ohos_unittest("test_observer_test") { 53 module_out_path = module_output_path 54 55 configs = [ ":tools_ability_delegator_config" ] 56 57 sources = [ "test_observer_test.cpp" ] 58 sources += ability_delegator_mock_sources 59 60 deps = [ 61 "${ability_runtime_path}/tools/aa:tools_aa_source_set", 62 "//third_party/googletest:gmock_main", 63 "//third_party/googletest:gtest_main", 64 ] 65 66 external_deps = [ 67 "ability_base:configuration", 68 "bundle_framework:appexecfwk_base", 69 "hiviewdfx_hilog_native:libhilog", 70 "ipc:ipc_core", 71 ] 72} 73 74ohos_unittest("shell_command_result_test") { 75 module_out_path = module_output_path 76 77 sources = [ "shell_command_result_test.cpp" ] 78 79 configs = [ ":tools_ability_delegator_config" ] 80 81 deps = [ 82 "${ability_runtime_path}/tools/aa:tools_aa_source_set", 83 "//third_party/googletest:gmock_main", 84 "//third_party/googletest:gtest_main", 85 ] 86 87 external_deps = [ 88 "ability_base:configuration", 89 "bundle_framework:appexecfwk_base", 90 "hiviewdfx_hilog_native:libhilog", 91 "ipc:ipc_core", 92 ] 93} 94 95group("unittest") { 96 testonly = true 97 98 deps = [ 99 ":ability_command_test", 100 ":shell_command_result_test", 101 ":test_observer_test", 102 ] 103} 104