1# Copyright (C) 2021-2025 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("../../config.gni") 16 17SUBSYSTEM_DIR = "../../" 18IPC_TEST_ROOT = "$SUBSYSTEM_DIR/ipc/test" 19IPC_CORE_ROOT = "$SUBSYSTEM_DIR/ipc/native" 20MODULE_OUTPUT_PATH = "ipc" 21 22template("ipc_moduletest") { 23 ohos_moduletest(target_name) { 24 module_out_path = MODULE_OUTPUT_PATH 25 26 configs = [ 27 "$SUBSYSTEM_DIR/config:ipc_util_config", 28 "$SUBSYSTEM_DIR/config:dsoftbus_header_deps_config", 29 ] 30 include_dirs = [ 31 "$IPC_CORE_ROOT/c/rpc/include", 32 "$IPC_CORE_ROOT/c/ipc_adapter/include", 33 "$IPC_CORE_ROOT/c/adapter/access_token/include", 34 "$IPC_CORE_ROOT/src/core/include", 35 "$IPC_CORE_ROOT/src/mock/include", 36 "$SUBSYSTEM_DIR/interfaces/innerkits/c_api/include", 37 "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core/include", 38 "$SUBSYSTEM_DIR/interfaces/innerkits/libdbinder/include", 39 "$SUBSYSTEM_DIR/utils/include", 40 "$SUBSYSTEM_DIR/native/src/core/include", 41 "$SUBSYSTEM_DIR/ipc/native/src/mock/include/", 42 "$SUBSYSTEM_DIR/ipc/test/auxiliary/native/include/", 43 ] 44 45 if (defined(invoker.include_dirs)) { 46 include_dirs += invoker.include_dirs 47 } 48 49 deps = [ 50 "$IPC_CORE_ROOT/src/core:ipc_common", 51 "$IPC_TEST_ROOT/auxiliary/native:TestAssistance", 52 "$SUBSYSTEM_DIR/interfaces/innerkits/c_api:ipc_capi", 53 "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_single:ipc_single", 54 ] 55 if (defined(invoker.deps)) { 56 deps += invoker.deps 57 } 58 59 external_deps = [ 60 "c_utils:utils", 61 "googletest:gmock", 62 "hilog:libhilog", 63 "samgr:samgr_proxy", 64 ] 65 if (defined(invoker.external_deps)) { 66 external_deps += invoker.external_deps 67 } 68 69 sources = invoker.sources 70 ldflags = [ "-lpthread" ] 71 72 resource_config_file = "$SUBSYSTEM_DIR/test/resource/ipc/ohos_test.xml" 73 } 74} 75 76############################################################################### 77if (ipc_feature_test_enabled) { 78 ipc_moduletest("IPCCpiModuleTest") { 79 sources = [ "ipc/c/ipc_capi_remote_object_module_test.cpp" ] 80 } 81} 82 83############################################################################### 84 85group("moduletest") { 86 testonly = true 87 if (ipc_feature_test_enabled) { 88 deps = [ ":IPCCpiModuleTest" ] 89 } 90} 91