1# Copyright (c) 2021 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/aafwk/standard/aafwk.gni") 16 17module_output_path = "aafwk_standard/tools" 18 19config("tools_aa_config_mock") { 20 include_dirs = [ 21 "${aafwk_path}/tools/test/mock", 22 "//third_party/googletest/googlemock/include", 23 ] 24} 25 26tools_aa_mock_sources = 27 [ "${aafwk_path}/tools/test/mock/mock_ability_manager_stub.cpp" ] 28 29ohos_moduletest("aa_command_start_module_test") { 30 module_out_path = module_output_path 31 32 sources = [ "aa_command_start_module_test.cpp" ] 33 sources += tools_aa_mock_sources 34 35 configs = [ ":tools_aa_config_mock" ] 36 37 cflags = [] 38 if (target_cpu == "arm") { 39 cflags += [ "-DBINDER_IPC_32BIT" ] 40 } 41 42 deps = [ 43 "${aafwk_path}/tools/aa:tools_aa_source_set", 44 "//third_party/googletest:gmock_main", 45 "//third_party/googletest:gtest_main", 46 ] 47 48 external_deps = [ 49 "appexecfwk_standard:appexecfwk_base", 50 "hiviewdfx_hilog_native:libhilog", 51 "ipc:ipc_core", 52 ] 53} 54 55ohos_moduletest("aa_command_stop_service_module_test") { 56 module_out_path = module_output_path 57 58 sources = [ "aa_command_stop_service_module_test.cpp" ] 59 sources += tools_aa_mock_sources 60 61 configs = [ ":tools_aa_config_mock" ] 62 63 cflags = [] 64 if (target_cpu == "arm") { 65 cflags += [ "-DBINDER_IPC_32BIT" ] 66 } 67 68 deps = [ 69 "${aafwk_path}/tools/aa:tools_aa_source_set", 70 "//third_party/googletest:gmock_main", 71 "//third_party/googletest:gtest_main", 72 ] 73 74 external_deps = [ 75 "appexecfwk_standard:appexecfwk_base", 76 "hiviewdfx_hilog_native:libhilog", 77 "ipc:ipc_core", 78 ] 79} 80 81ohos_moduletest("aa_command_dump_module_test") { 82 module_out_path = module_output_path 83 84 sources = [ "aa_command_dump_module_test.cpp" ] 85 sources += tools_aa_mock_sources 86 87 configs = [ ":tools_aa_config_mock" ] 88 89 cflags = [] 90 if (target_cpu == "arm") { 91 cflags += [ "-DBINDER_IPC_32BIT" ] 92 } 93 94 deps = [ 95 "${aafwk_path}/tools/aa:tools_aa_source_set", 96 "//third_party/googletest:gmock_main", 97 "//third_party/googletest:gtest_main", 98 ] 99 100 external_deps = [ 101 "appexecfwk_standard:appexecfwk_base", 102 "hiviewdfx_hilog_native:libhilog", 103 "ipc:ipc_core", 104 ] 105} 106 107group("moduletest") { 108 testonly = true 109 110 deps = [ 111 ":aa_command_dump_module_test", 112 ":aa_command_start_module_test", 113 ":aa_command_stop_service_module_test", 114 ] 115} 116