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") 15 16SUBSYSTEM_DIR = "//foundation/communication/ipc" 17DBINDER_TEST_ROOT = "//foundation/communication/ipc/services/dbinder/test" 18MODULE_OUTPUT_PATH = "ipc/services/dbinder" 19 20############################################################################### 21config("libtestdbinder_config") { 22 visibility = [ ":*" ] 23 cflags = [] 24 if (is_standard_system) { 25 cflags += [ "-DCONFIG_STANDARD_SYSTEM" ] 26 } 27 include_dirs = [ 28 "//commonlibrary/c_utils/base/include", 29 "//utils/system/safwk/native/include", 30 "//test/testfwk/developer_test/aw/distributed", 31 "$SUBSYSTEM_DIR/utils/include", 32 "$SUBSYSTEM_DIR/services/dbinder/dbinder_service/include", 33 "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core/include", 34 "$DBINDER_TEST_ROOT/distributedtest/include", 35 ] 36} 37 38ohos_distributedtest("DbinderTest") { 39 module_out_path = MODULE_OUTPUT_PATH 40 41 sources = [ 42 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_distributed_test.cpp", 43 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_service_test_helper.cpp", 44 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_service.cpp", 45 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_service_skeleton.cpp", 46 ] 47 48 configs = [ ":libtestdbinder_config" ] 49 50 deps = [ 51 ":dbinder_send", 52 ":dbinder_test", 53 "$SUBSYSTEM_DIR/interfaces/innerkits/libdbinder:libdbinder", 54 "//third_party/googletest:gtest_main", 55 ] 56 57 external_deps = [ 58 "c_utils:utils", 59 "hiviewdfx_hilog_native:libhilog", 60 "ipc:ipc_core", 61 "samgr:samgr_proxy", 62 ] 63 64 subsystem_name = "communication" 65 resource_config_file = 66 "//foundation/communication/ipc/test/resource/services/ohos_test.xml" 67} 68 69ohos_distributedtest("DbinderTestAgent") { 70 module_out_path = MODULE_OUTPUT_PATH 71 72 sources = [ 73 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_service_test_helper.cpp", 74 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_agent.cpp", 75 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_service.cpp", 76 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_service_skeleton.cpp", 77 ] 78 79 configs = [ ":libtestdbinder_config" ] 80 81 deps = [ 82 ":dbinder_send", 83 ":dbinder_test", 84 "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core:ipc_core", 85 "//third_party/googletest:gtest", 86 ] 87 88 external_deps = [ 89 "c_utils:utils", 90 "dsoftbus:softbus_client", 91 "hiviewdfx_hilog_native:libhilog", 92 "samgr:samgr_proxy", 93 ] 94 95 subsystem_name = "communication" 96 resource_config_file = 97 "//foundation/communication/ipc/test/resource/services/ohos_test.xml" 98} 99 100############################################################################### 101ohos_executable("dbinder_test") { 102 sources = [ 103 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_server_main.cpp", 104 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_service.cpp", 105 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_service_skeleton.cpp", 106 ] 107 108 configs = [ ":libtestdbinder_config" ] 109 110 deps = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core:ipc_core" ] 111 112 external_deps = [ 113 "c_utils:utils", 114 "hiviewdfx_hilog_native:libhilog", 115 "samgr:samgr_proxy", 116 ] 117 118 part_name = "ipc" 119 subsystem_name = "communication" 120} 121 122ohos_executable("dbinder_send") { 123 sources = [ 124 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_server_main.cpp", 125 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_service.cpp", 126 "$DBINDER_TEST_ROOT/distributedtest/src/dbinder_test_service_skeleton.cpp", 127 ] 128 129 cflags_cc = [ "-DDBINDER_TEST_SECOND" ] 130 131 configs = [ ":libtestdbinder_config" ] 132 133 deps = [ "$SUBSYSTEM_DIR/interfaces/innerkits/ipc_core:ipc_core" ] 134 135 external_deps = [ 136 "c_utils:utils", 137 "hiviewdfx_hilog_native:libhilog", 138 "samgr:samgr_proxy", 139 ] 140 141 part_name = "ipc" 142 subsystem_name = "communication" 143} 144 145ohos_distributedtest_py("dbindertest_py") { 146 module_out_path = MODULE_OUTPUT_PATH 147 sources = [ "test_dbinder.py" ] 148} 149 150############################################################################### 151group("distributedtest") { 152 testonly = true 153 deps = [ 154 ":DbinderTest", 155 ":DbinderTestAgent", 156 ":dbinder_send", 157 ":dbinder_test", 158 ":dbindertest_py", 159 ] 160} 161 162group("moduletest") { 163 testonly = true 164 deps = [ "moduletest" ] 165} 166