106f6ba60Sopenharmony_ci# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
206f6ba60Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
306f6ba60Sopenharmony_ci# you may not use this file except in compliance with the License.
406f6ba60Sopenharmony_ci# You may obtain a copy of the License at
506f6ba60Sopenharmony_ci#
606f6ba60Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
706f6ba60Sopenharmony_ci#
806f6ba60Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
906f6ba60Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1006f6ba60Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1106f6ba60Sopenharmony_ci# See the License for the specific language governing permissions and
1206f6ba60Sopenharmony_ci# limitations under the License.
1306f6ba60Sopenharmony_ci
1406f6ba60Sopenharmony_ciimport("//build/test.gni")
1506f6ba60Sopenharmony_ciimport("../../../base/config.gni")
1606f6ba60Sopenharmony_ci
1706f6ba60Sopenharmony_cimodule_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device"
1806f6ba60Sopenharmony_ciconfig("module_private_config") {
1906f6ba60Sopenharmony_ci  visibility = [ ":*" ]
2006f6ba60Sopenharmony_ci}
2106f6ba60Sopenharmony_ci
2206f6ba60Sopenharmony_ciohos_unittest("ipc_ut") {
2306f6ba60Sopenharmony_ci  module_out_path = module_output_path
2406f6ba60Sopenharmony_ci  sources = [
2506f6ba60Sopenharmony_ci    "../src/ipc_generator_impl.cpp",
2606f6ba60Sopenharmony_ci    "unittest/client_connection_test.cpp",
2706f6ba60Sopenharmony_ci    "unittest/client_map_test.cpp",
2806f6ba60Sopenharmony_ci    "unittest/ipc_generator_impl_test.cpp",
2906f6ba60Sopenharmony_ci    "unittest/service_base_test.cpp",
3006f6ba60Sopenharmony_ci    "unittest/service_entry_test.cpp",
3106f6ba60Sopenharmony_ci    "unittest/socket_context_test.cpp",
3206f6ba60Sopenharmony_ci    "unittest/unix_socket_client_test.cpp",
3306f6ba60Sopenharmony_ci    "unittest/unix_socket_server_test.cpp",
3406f6ba60Sopenharmony_ci  ]
3506f6ba60Sopenharmony_ci  include_dirs = [ "${OHOS_PROFILER_DIR}/device/services/ipc/include" ]
3606f6ba60Sopenharmony_ci  deps = [
3706f6ba60Sopenharmony_ci    "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_source",
3806f6ba60Sopenharmony_ci    "${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto",
3906f6ba60Sopenharmony_ci    "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source",
4006f6ba60Sopenharmony_ci    "../:ipc",
4106f6ba60Sopenharmony_ci  ]
4206f6ba60Sopenharmony_ci  cflags = [
4306f6ba60Sopenharmony_ci    "-Wno-inconsistent-missing-override",
4406f6ba60Sopenharmony_ci    "-Dprivate=public",  #allow test code access private members
4506f6ba60Sopenharmony_ci    "-Dprotected=public",  #allow test code access private members
4606f6ba60Sopenharmony_ci  ]
4706f6ba60Sopenharmony_ci  external_deps = [
4806f6ba60Sopenharmony_ci    "googletest:gtest",
4906f6ba60Sopenharmony_ci    "hilog:libhilog_base",
5006f6ba60Sopenharmony_ci    "protobuf:protobuf_lite",
5106f6ba60Sopenharmony_ci  ]
5206f6ba60Sopenharmony_ci  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
5306f6ba60Sopenharmony_ci}
5406f6ba60Sopenharmony_ci
5506f6ba60Sopenharmony_cigroup("unittest") {
5606f6ba60Sopenharmony_ci  testonly = true
5706f6ba60Sopenharmony_ci  deps = [ ":ipc_ut" ]
5806f6ba60Sopenharmony_ci}
59