BUILD.gn 3.6 KB
Newer Older
M
mamingshuai 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")

SUBSYSTEM_DIR = "//foundation/communication/ipc"
IPC_TEST_ROOT = "//foundation/communication/ipc/ipc/test"

ohos_shared_library("ipc_test_helper") {
  include_dirs = [ "//utils/system/safwk/native/include" ]

  sources = [
    "./src/assist_test_service.cpp",
    "./src/foo_service.cpp",
    "./src/ipc_test_helper.cpp",
    "./src/test_service.cpp",
    "./src/test_service_client.cpp",
    "./src/test_service_skeleton.cpp",
  ]

  configs = [
    "$IPC_TEST_ROOT:ipc_test_config",
    "$SUBSYSTEM_DIR:ipc_util_config",
  ]

  deps = [ "//utils/native/base:utils" ]

  external_deps = [
东方_月初's avatar
东方_月初 已提交
38
    "ipc:ipc_core",
Z
zgit2021 已提交
39
    "hiviewdfx_hilog_native:libhilog",
东方_月初's avatar
东方_月初 已提交
40
    "samgr_standard:samgr_proxy",
M
mamingshuai 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
  ]

  part_name = "ipc"
  subsystem_name = "communication"
}

ohos_executable("ipc_server_test") {
  sources = [ "./src/main_server.cpp" ]

  configs = [
    "$SUBSYSTEM_DIR:ipc_util_config",
    "$IPC_TEST_ROOT:ipc_test_config",
  ]

  deps = [
    ":ipc_test_helper",
    "//utils/native/base:utils",
  ]

  external_deps = [
东方_月初's avatar
东方_月初 已提交
61
    "ipc:ipc_core",
Z
zgit2021 已提交
62
    "hiviewdfx_hilog_native:libhilog",
东方_月初's avatar
东方_月初 已提交
63
    "samgr_standard:samgr_proxy",
M
mamingshuai 已提交
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
  ]

  part_name = "ipc"
  subsystem_name = "communication"
}

ohos_executable("ipc_client_test") {
  sources = [ "./src/main_client.cpp" ]

  configs = [
    "$SUBSYSTEM_DIR:ipc_util_config",
    "$IPC_TEST_ROOT:ipc_test_config",
  ]

  deps = [
    ":ipc_test_helper",
    "//utils/native/base:utils",
  ]

  external_deps = [
东方_月初's avatar
东方_月初 已提交
84
    "ipc:ipc_core",
Z
zgit2021 已提交
85
    "hiviewdfx_hilog_native:libhilog",
东方_月初's avatar
东方_月初 已提交
86
    "samgr_standard:samgr_proxy",
M
mamingshuai 已提交
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
  ]

  part_name = "ipc"
  subsystem_name = "communication"
}

ohos_shared_library("ipc_test_helper_extra") {
  include_dirs = [ "//utils/system/safwk/native/include" ]

  sources = [
    "./src/assist_test_service.cpp",
    "./src/foo_service.cpp",
    "./src/ipc_test_helper.cpp",
    "./src/test_service.cpp",
    "./src/test_service_client.cpp",
    "./src/test_service_skeleton.cpp",
  ]

  cflags = [ "-DIPCSERVERTESTEXTRA" ]

  configs = [
    "$IPC_TEST_ROOT:ipc_test_config",
    "$SUBSYSTEM_DIR:ipc_util_config",
  ]

  deps = [ "//utils/native/base:utils" ]

  external_deps = [
东方_月初's avatar
东方_月初 已提交
115
    "ipc:ipc_core",
Z
zgit2021 已提交
116
    "hiviewdfx_hilog_native:libhilog",
东方_月初's avatar
东方_月初 已提交
117
    "samgr_standard:samgr_proxy",
M
mamingshuai 已提交
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
  ]

  part_name = "ipc"
  subsystem_name = "communication"
}

ohos_executable("ipc_server_test_extra") {
  sources = [ "./src/main_server.cpp" ]

  configs = [
    "$SUBSYSTEM_DIR:ipc_util_config",
    "$IPC_TEST_ROOT:ipc_test_config",
  ]

  deps = [
    ":ipc_test_helper_extra",
    "//utils/native/base:utils",
  ]

  external_deps = [
东方_月初's avatar
东方_月初 已提交
138
    "ipc:ipc_core",
Z
zgit2021 已提交
139
    "hiviewdfx_hilog_native:libhilog",
东方_月初's avatar
东方_月初 已提交
140
    "samgr_standard:samgr_proxy",
M
mamingshuai 已提交
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
  ]

  part_name = "ipc"
  subsystem_name = "communication"
}

###############################################################################
group("TestAssistance") {
  testonly = true
  deps = [
    ":ipc_client_test",
    ":ipc_server_test",
    ":ipc_server_test_extra",
    ":ipc_test_helper",
  ]
}
###############################################################################