• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("../../../base/config.gni")
16
17module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device"
18config("module_private_config") {
19  visibility = [ ":*" ]
20}
21
22ohos_unittest("ipc_ut") {
23  module_out_path = module_output_path
24  sources = [
25    "../src/ipc_generator_impl.cpp",
26    "unittest/client_connection_test.cpp",
27    "unittest/client_map_test.cpp",
28    "unittest/ipc_generator_impl_test.cpp",
29    "unittest/service_base_test.cpp",
30    "unittest/service_entry_test.cpp",
31    "unittest/socket_context_test.cpp",
32    "unittest/unix_socket_client_test.cpp",
33    "unittest/unix_socket_server_test.cpp",
34  ]
35  include_dirs = [
36    "${OHOS_PROFILER_DIR}/device/services/ipc/include",
37    "//third_party/googletest/googletest/include/gtest",
38  ]
39  deps = [
40    "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_source",
41    "${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto",
42    "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source",
43    "../:ipc",
44    "//third_party/googletest:gtest",
45  ]
46  cflags = [
47    "-Wno-inconsistent-missing-override",
48    "-Dprivate=public",  #allow test code access private members
49    "-Dprotected=public",  #allow test code access private members
50  ]
51  external_deps = [ "hilog:libhilog" ]
52  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
53}
54
55group("unittest") {
56  testonly = true
57  deps = [ ":ipc_ut" ]
58}
59