BUILD.gn 10.8 KB
Newer Older
W
wangshi 已提交
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
# Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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("//test/xts/tools/build/suite.gni")

import("//test/xts/acts/arkui/libuv/comm.gni")

ohos_static_library("libuvTestStatic") {
  include_dirs = [
    "//third_party/libuv/include",
    "//third_party/libuv/src",
    "//third_party/libuv/src/unix",
  ]
  sources = [
    "//third_party/libuv/test/blackhole-server.c",
    "//third_party/libuv/test/echo-server.c",
W
wangshi 已提交
27
    "//third_party/libuv/test/runner-unix.c",
W
wangshi 已提交
28 29 30
    "//third_party/libuv/test/runner.c",
    "//third_party/libuv/test/test-active.c",
    "//third_party/libuv/test/test-async-null-cb.c",
W
wangshi 已提交
31
    "//third_party/libuv/test/test-async.c",
W
wangshi 已提交
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    "//third_party/libuv/test/test-barrier.c",
    "//third_party/libuv/test/test-callback-order.c",
    "//third_party/libuv/test/test-callback-stack.c",
    "//third_party/libuv/test/test-close-fd.c",
    "//third_party/libuv/test/test-close-order.c",
    "//third_party/libuv/test/test-condvar.c",
    "//third_party/libuv/test/test-connect-unspecified.c",
    "//third_party/libuv/test/test-connection-fail.c",
    "//third_party/libuv/test/test-cwd-and-chdir.c",
    "//third_party/libuv/test/test-default-loop-close.c",
    "//third_party/libuv/test/test-delayed-accept.c",
    "//third_party/libuv/test/test-dlerror.c",
    "//third_party/libuv/test/test-eintr-handling.c",
    "//third_party/libuv/test/test-embed.c",
    "//third_party/libuv/test/test-emfile.c",
    "//third_party/libuv/test/test-env-vars.c",
    "//third_party/libuv/test/test-error.c",
    "//third_party/libuv/test/test-fail-always.c",
    "//third_party/libuv/test/test-fork.c",
    "//third_party/libuv/test/test-fs-copyfile.c",
    "//third_party/libuv/test/test-fs-event.c",
    "//third_party/libuv/test/test-fs-fd-hash.c",
    "//third_party/libuv/test/test-fs-open-flags.c",
W
wangshi 已提交
55 56 57
    "//third_party/libuv/test/test-fs-poll.c",
    "//third_party/libuv/test/test-fs-readdir.c",
    "//third_party/libuv/test/test-fs.c",
W
wangshi 已提交
58
    "//third_party/libuv/test/test-get-currentexe.c",
W
wangshi 已提交
59
    "//third_party/libuv/test/test-get-loadavg.c",
W
wangshi 已提交
60 61 62 63 64 65
    "//third_party/libuv/test/test-get-memory.c",
    "//third_party/libuv/test/test-get-passwd.c",
    "//third_party/libuv/test/test-getaddrinfo.c",
    "//third_party/libuv/test/test-gethostname.c",
    "//third_party/libuv/test/test-getnameinfo.c",
    "//third_party/libuv/test/test-getsockname.c",
W
wangshi 已提交
66
    "//third_party/libuv/test/test-getters-setters.c",
W
wangshi 已提交
67 68 69 70 71 72
    "//third_party/libuv/test/test-gettimeofday.c",
    "//third_party/libuv/test/test-handle-fileno.c",
    "//third_party/libuv/test/test-homedir.c",
    "//third_party/libuv/test/test-hrtime.c",
    "//third_party/libuv/test/test-idle.c",
    "//third_party/libuv/test/test-idna.c",
W
wangshi 已提交
73
    "//third_party/libuv/test/test-ip-name.c",
W
wangshi 已提交
74 75 76 77 78 79 80
    "//third_party/libuv/test/test-ip4-addr.c",
    "//third_party/libuv/test/test-ip6-addr.c",
    "//third_party/libuv/test/test-ipc-heavy-traffic-deadlock-bug.c",
    "//third_party/libuv/test/test-ipc-send-recv.c",
    "//third_party/libuv/test/test-ipc.c",
    "//third_party/libuv/test/test-loop-alive.c",
    "//third_party/libuv/test/test-loop-close.c",
W
wangshi 已提交
81 82
    "//third_party/libuv/test/test-loop-configure.c",
    "//third_party/libuv/test/test-loop-handles.c",
W
wangshi 已提交
83 84
    "//third_party/libuv/test/test-loop-stop.c",
    "//third_party/libuv/test/test-loop-time.c",
W
wangshi 已提交
85
    "//third_party/libuv/test/test-metrics.c",
W
wangshi 已提交
86 87 88
    "//third_party/libuv/test/test-multiple-listen.c",
    "//third_party/libuv/test/test-mutexes.c",
    "//third_party/libuv/test/test-not-readable-nor-writable-on-read-error.c",
W
wangshi 已提交
89
    "//third_party/libuv/test/test-not-writable-after-shutdown.c",
W
wangshi 已提交
90 91 92 93
    "//third_party/libuv/test/test-osx-select.c",
    "//third_party/libuv/test/test-pass-always.c",
    "//third_party/libuv/test/test-ping-pong.c",
    "//third_party/libuv/test/test-pipe-bind-error.c",
W
wangshi 已提交
94
    "//third_party/libuv/test/test-pipe-close-stdout-read-stdin.c",
W
wangshi 已提交
95 96 97 98 99 100 101 102
    "//third_party/libuv/test/test-pipe-connect-error.c",
    "//third_party/libuv/test/test-pipe-connect-multiple.c",
    "//third_party/libuv/test/test-pipe-connect-prepare.c",
    "//third_party/libuv/test/test-pipe-getsockname.c",
    "//third_party/libuv/test/test-pipe-pending-instances.c",
    "//third_party/libuv/test/test-pipe-sendmsg.c",
    "//third_party/libuv/test/test-pipe-server-close.c",
    "//third_party/libuv/test/test-pipe-set-fchmod.c",
W
wangshi 已提交
103
    "//third_party/libuv/test/test-pipe-set-non-blocking.c",
W
wangshi 已提交
104 105
    "//third_party/libuv/test/test-platform-output.c",
    "//third_party/libuv/test/test-poll-close-doesnt-corrupt-stack.c",
W
wangshi 已提交
106
    "//third_party/libuv/test/test-poll-close.c",
W
wangshi 已提交
107
    "//third_party/libuv/test/test-poll-closesocket.c",
W
wangshi 已提交
108
    "//third_party/libuv/test/test-poll-multiple-handles.c",
W
wangshi 已提交
109
    "//third_party/libuv/test/test-poll-oob.c",
W
wangshi 已提交
110
    "//third_party/libuv/test/test-poll.c",
W
wangshi 已提交
111 112
    "//third_party/libuv/test/test-process-priority.c",
    "//third_party/libuv/test/test-process-title-threadsafe.c",
W
wangshi 已提交
113
    "//third_party/libuv/test/test-process-title.c",
W
wangshi 已提交
114 115
    "//third_party/libuv/test/test-queue-foreach-delete.c",
    "//third_party/libuv/test/test-random.c",
W
wangshi 已提交
116
    "//third_party/libuv/test/test-readable-on-eof.c",
W
wangshi 已提交
117 118 119 120 121 122
    "//third_party/libuv/test/test-ref.c",
    "//third_party/libuv/test/test-run-nowait.c",
    "//third_party/libuv/test/test-run-once.c",
    "//third_party/libuv/test/test-semaphore.c",
    "//third_party/libuv/test/test-shutdown-close.c",
    "//third_party/libuv/test/test-shutdown-eof.c",
W
wangshi 已提交
123
    "//third_party/libuv/test/test-shutdown-simultaneous.c",
W
wangshi 已提交
124 125 126 127 128 129 130 131 132 133 134
    "//third_party/libuv/test/test-shutdown-twice.c",
    "//third_party/libuv/test/test-signal-multiple-loops.c",
    "//third_party/libuv/test/test-signal-pending-on-close.c",
    "//third_party/libuv/test/test-signal.c",
    "//third_party/libuv/test/test-socket-buffer-size.c",
    "//third_party/libuv/test/test-spawn.c",
    "//third_party/libuv/test/test-stdio-over-pipes.c",
    "//third_party/libuv/test/test-strscpy.c",
    "//third_party/libuv/test/test-tcp-alloc-cb-fail.c",
    "//third_party/libuv/test/test-tcp-bind-error.c",
    "//third_party/libuv/test/test-tcp-bind6-error.c",
W
wangshi 已提交
135 136
    "//third_party/libuv/test/test-tcp-close-accept.c",
    "//third_party/libuv/test/test-tcp-close-reset.c",
W
wangshi 已提交
137 138 139 140 141 142
    "//third_party/libuv/test/test-tcp-close-while-connecting.c",
    "//third_party/libuv/test/test-tcp-close.c",
    "//third_party/libuv/test/test-tcp-connect-error-after-write.c",
    "//third_party/libuv/test/test-tcp-connect-error.c",
    "//third_party/libuv/test/test-tcp-connect-timeout.c",
    "//third_party/libuv/test/test-tcp-connect6-error.c",
W
wangshi 已提交
143
    "//third_party/libuv/test/test-tcp-create-socket-early.c",
W
wangshi 已提交
144 145 146
    "//third_party/libuv/test/test-tcp-flags.c",
    "//third_party/libuv/test/test-tcp-oob.c",
    "//third_party/libuv/test/test-tcp-open.c",
W
wangshi 已提交
147 148 149 150 151

    #    "//third_party/libuv/test/test-metrics-idle-time.c",
    #    "//third_party/libuv/test/test-metrics-idle-time-thread.c",
    #    "//third_party/libuv/test/test-metrics-idle-time-zero.c",
    "//third_party/libuv/test/test-tcp-read-stop-start.c",
W
wangshi 已提交
152 153
    "//third_party/libuv/test/test-tcp-read-stop.c",
    "//third_party/libuv/test/test-tcp-shutdown-after-write.c",
W
wangshi 已提交
154 155
    "//third_party/libuv/test/test-tcp-try-write-error.c",
    "//third_party/libuv/test/test-tcp-try-write.c",
W
wangshi 已提交
156 157 158 159
    "//third_party/libuv/test/test-tcp-unexpected-read.c",
    "//third_party/libuv/test/test-tcp-write-after-connect.c",
    "//third_party/libuv/test/test-tcp-write-fail.c",
    "//third_party/libuv/test/test-tcp-write-queue-order.c",
W
wangshi 已提交
160 161 162
    "//third_party/libuv/test/test-tcp-write-to-half-open-connection.c",
    "//third_party/libuv/test/test-tcp-writealot.c",
    "//third_party/libuv/test/test-test-macros.c",
W
wangshi 已提交
163 164 165 166 167 168 169 170 171 172 173 174 175 176
    "//third_party/libuv/test/test-thread-equal.c",
    "//third_party/libuv/test/test-thread.c",
    "//third_party/libuv/test/test-threadpool-cancel.c",
    "//third_party/libuv/test/test-threadpool.c",
    "//third_party/libuv/test/test-timer-again.c",
    "//third_party/libuv/test/test-timer-from-check.c",
    "//third_party/libuv/test/test-timer.c",
    "//third_party/libuv/test/test-tmpdir.c",
    "//third_party/libuv/test/test-tty-duplicate-key.c",
    "//third_party/libuv/test/test-tty-escape-sequence-processing.c",
    "//third_party/libuv/test/test-tty.c",
    "//third_party/libuv/test/test-udp-alloc-cb-fail.c",
    "//third_party/libuv/test/test-udp-bind.c",
    "//third_party/libuv/test/test-udp-connect.c",
W
wangshi 已提交
177
    "//third_party/libuv/test/test-udp-connect6.c",
W
wangshi 已提交
178 179 180
    "//third_party/libuv/test/test-udp-create-socket-early.c",
    "//third_party/libuv/test/test-udp-dgram-too-big.c",
    "//third_party/libuv/test/test-udp-ipv6.c",
W
wangshi 已提交
181
    "//third_party/libuv/test/test-udp-mmsg.c",
W
wangshi 已提交
182 183 184 185 186 187 188 189 190 191 192
    "//third_party/libuv/test/test-udp-multicast-interface.c",
    "//third_party/libuv/test/test-udp-multicast-interface6.c",
    "//third_party/libuv/test/test-udp-multicast-join.c",
    "//third_party/libuv/test/test-udp-multicast-join6.c",
    "//third_party/libuv/test/test-udp-multicast-ttl.c",
    "//third_party/libuv/test/test-udp-open.c",
    "//third_party/libuv/test/test-udp-options.c",
    "//third_party/libuv/test/test-udp-send-and-recv.c",
    "//third_party/libuv/test/test-udp-send-hang-loop.c",
    "//third_party/libuv/test/test-udp-send-immediate.c",
    "//third_party/libuv/test/test-udp-send-unreachable.c",
W
wangshi 已提交
193
    "//third_party/libuv/test/test-udp-sendmmsg-error.c",
W
wangshi 已提交
194 195 196 197 198
    "//third_party/libuv/test/test-udp-try-send.c",
    "//third_party/libuv/test/test-uname.c",
    "//third_party/libuv/test/test-walk-handles.c",
    "//third_party/libuv/test/test-watcher-cross-stop.c",
  ]
W
wangshi 已提交
199
  deps = [ "//third_party/libuv:uv_static" ]
W
wangshi 已提交
200 201 202 203 204 205 206 207
}

ohos_executable("libuvRunTest") {
  include_dirs = [
    "//third_party/libuv/include",
    "//third_party/libuv/src",
    "//third_party/libuv/src/unix",
  ]
W
wangshi 已提交
208 209
  sources = [ "//third_party/libuv/test/run-tests.c" ]
  deps = [ ":libuvTestStatic" ]
W
wangshi 已提交
210 211 212
}

ohos_moduletest_suite("ActsLibuvTestSuite") {
W
wangshi 已提交
213
  sources = [ "src/ActsLibuvTestSuite.cpp" ]
W
wangshi 已提交
214

W
wangshi 已提交
215 216
  include_dirs = [
    "//test/xts/acts/arkui/libuv/src",
W
wangshi 已提交
217 218 219 220 221
    "//third_party/libuv/test",
    "//third_party/libuv/include",
    "//third_party/libuv/src",
    "//third_party/libuv/src/unix",
  ]
W
wangshi 已提交
222
  deps = [ ":libuvTestStatic" ]
W
wangshi 已提交
223 224 225 226 227 228 229
  cflags = [ "-Wno-error" ]
}

action("cpLibuv") {
  testonly = true
  script = "cplibuv.sh"
  outputs = [ "${target_out_dir}/cpvkgl.log" ]
W
wangshi 已提交
230
  deps = [
W
wangshi 已提交
231 232 233 234 235 236 237 238 239 240 241
    ":ActsLibuvTestSuite",
    ":libuvRunTest",
  ]
}

group("libuvTest") {
  testonly = true
  if (is_standard_system) {
    deps = [
      ":ActsLibuvTestSuite",
      ":cpLibuv",
W
wangshi 已提交
242
      ":libuvRunTest",
W
wangshi 已提交
243 244
    ]
  }
W
wangshi 已提交
245
}