xref: /test/xts/acts/arkui/libuv/BUILD.gn (revision f6603c60)
1# Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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("//test/xts/tools/build/suite.gni")
15
16import("//test/xts/acts/arkui/libuv/comm.gni")
17
18ohos_static_library("libuvTestStatic") {
19  include_dirs = [
20    "//third_party/libuv/include",
21    "//third_party/libuv/src",
22    "//third_party/libuv/src/unix",
23  ]
24  part_name = "libuv"
25  subsystem_name = "thirdparty"
26  sources = [
27    "//third_party/libuv/test/blackhole-server.c",
28    "//third_party/libuv/test/echo-server.c",
29    "//third_party/libuv/test/runner-unix.c",
30    "//third_party/libuv/test/runner.c",
31    "//third_party/libuv/test/test-active.c",
32    "//third_party/libuv/test/test-async-null-cb.c",
33    "//third_party/libuv/test/test-async.c",
34    "//third_party/libuv/test/test-barrier.c",
35    "//third_party/libuv/test/test-callback-stack.c",
36    "//third_party/libuv/test/test-close-fd.c",
37    "//third_party/libuv/test/test-close-order.c",
38    "//third_party/libuv/test/test-condvar.c",
39    "//third_party/libuv/test/test-connect-unspecified.c",
40    "//third_party/libuv/test/test-connection-fail.c",
41    "//third_party/libuv/test/test-cwd-and-chdir.c",
42    "//third_party/libuv/test/test-default-loop-close.c",
43    "//third_party/libuv/test/test-delayed-accept.c",
44    "//third_party/libuv/test/test-dlerror.c",
45    "//third_party/libuv/test/test-eintr-handling.c",
46    "//third_party/libuv/test/test-embed.c",
47    "//third_party/libuv/test/test-emfile.c",
48    "//third_party/libuv/test/test-env-vars.c",
49    "//third_party/libuv/test/test-error.c",
50    "//third_party/libuv/test/test-fail-always.c",
51    "//third_party/libuv/test/test-fork.c",
52    "//third_party/libuv/test/test-fs-copyfile.c",
53    "//third_party/libuv/test/test-fs-event.c",
54    "//third_party/libuv/test/test-fs-fd-hash.c",
55    "//third_party/libuv/test/test-fs-open-flags.c",
56    "//third_party/libuv/test/test-fs-poll.c",
57    "//third_party/libuv/test/test-fs-readdir.c",
58    "//third_party/libuv/test/test-fs.c",
59    "//third_party/libuv/test/test-get-currentexe.c",
60    "//third_party/libuv/test/test-get-loadavg.c",
61    "//third_party/libuv/test/test-get-memory.c",
62    "//third_party/libuv/test/test-get-passwd.c",
63    "//third_party/libuv/test/test-getaddrinfo.c",
64    "//third_party/libuv/test/test-gethostname.c",
65    "//third_party/libuv/test/test-getsockname.c",
66    "//third_party/libuv/test/test-getters-setters.c",
67    "//third_party/libuv/test/test-gettimeofday.c",
68    "//third_party/libuv/test/test-handle-fileno.c",
69    "//third_party/libuv/test/test-homedir.c",
70    "//third_party/libuv/test/test-hrtime.c",
71    "//third_party/libuv/test/test-idle.c",
72    "//third_party/libuv/test/test-idna.c",
73    "//third_party/libuv/test/test-ip-name.c",
74    "//third_party/libuv/test/test-ip4-addr.c",
75    "//third_party/libuv/test/test-ip6-addr.c",
76    "//third_party/libuv/test/test-ipc-heavy-traffic-deadlock-bug.c",
77    "//third_party/libuv/test/test-ipc-send-recv.c",
78    "//third_party/libuv/test/test-ipc.c",
79    "//third_party/libuv/test/test-loop-alive.c",
80    "//third_party/libuv/test/test-loop-close.c",
81    "//third_party/libuv/test/test-loop-configure.c",
82    "//third_party/libuv/test/test-loop-handles.c",
83    "//third_party/libuv/test/test-loop-stop.c",
84    "//third_party/libuv/test/test-loop-time.c",
85    "//third_party/libuv/test/test-metrics.c",
86    "//third_party/libuv/test/test-multiple-listen.c",
87    "//third_party/libuv/test/test-mutexes.c",
88    "//third_party/libuv/test/test-not-readable-nor-writable-on-read-error.c",
89    "//third_party/libuv/test/test-not-writable-after-shutdown.c",
90    "//third_party/libuv/test/test-osx-select.c",
91    "//third_party/libuv/test/test-pass-always.c",
92    "//third_party/libuv/test/test-ping-pong.c",
93    "//third_party/libuv/test/test-pipe-bind-error.c",
94    "//third_party/libuv/test/test-pipe-close-stdout-read-stdin.c",
95    "//third_party/libuv/test/test-pipe-connect-error.c",
96    "//third_party/libuv/test/test-pipe-connect-multiple.c",
97    "//third_party/libuv/test/test-pipe-connect-prepare.c",
98    "//third_party/libuv/test/test-pipe-getsockname.c",
99    "//third_party/libuv/test/test-pipe-pending-instances.c",
100    "//third_party/libuv/test/test-pipe-sendmsg.c",
101    "//third_party/libuv/test/test-pipe-server-close.c",
102    "//third_party/libuv/test/test-pipe-set-fchmod.c",
103    "//third_party/libuv/test/test-pipe-set-non-blocking.c",
104    "//third_party/libuv/test/test-platform-output.c",
105    "//third_party/libuv/test/test-poll-close-doesnt-corrupt-stack.c",
106    "//third_party/libuv/test/test-poll-close.c",
107    "//third_party/libuv/test/test-poll-closesocket.c",
108    "//third_party/libuv/test/test-poll-multiple-handles.c",
109    "//third_party/libuv/test/test-poll-oob.c",
110    "//third_party/libuv/test/test-poll.c",
111    "//third_party/libuv/test/test-process-priority.c",
112    "//third_party/libuv/test/test-process-title-threadsafe.c",
113    "//third_party/libuv/test/test-process-title.c",
114    "//third_party/libuv/test/test-queue-foreach-delete.c",
115    "//third_party/libuv/test/test-random.c",
116    "//third_party/libuv/test/test-readable-on-eof.c",
117    "//third_party/libuv/test/test-ref.c",
118    "//third_party/libuv/test/test-run-nowait.c",
119    "//third_party/libuv/test/test-run-once.c",
120    "//third_party/libuv/test/test-semaphore.c",
121    "//third_party/libuv/test/test-shutdown-close.c",
122    "//third_party/libuv/test/test-shutdown-eof.c",
123    "//third_party/libuv/test/test-shutdown-simultaneous.c",
124    "//third_party/libuv/test/test-shutdown-twice.c",
125    "//third_party/libuv/test/test-signal-multiple-loops.c",
126    "//third_party/libuv/test/test-signal-pending-on-close.c",
127    "//third_party/libuv/test/test-signal.c",
128    "//third_party/libuv/test/test-socket-buffer-size.c",
129    "//third_party/libuv/test/test-spawn.c",
130    "//third_party/libuv/test/test-stdio-over-pipes.c",
131    "//third_party/libuv/test/test-strscpy.c",
132    "//third_party/libuv/test/test-tcp-alloc-cb-fail.c",
133    "//third_party/libuv/test/test-tcp-bind-error.c",
134    "//third_party/libuv/test/test-tcp-bind6-error.c",
135    "//third_party/libuv/test/test-tcp-close-accept.c",
136    "//third_party/libuv/test/test-tcp-close-after-read-timeout.c",
137    "//third_party/libuv/test/test-tcp-close-reset.c",
138    "//third_party/libuv/test/test-tcp-close-while-connecting.c",
139    "//third_party/libuv/test/test-tcp-close.c",
140    "//third_party/libuv/test/test-tcp-connect-error-after-write.c",
141    "//third_party/libuv/test/test-tcp-connect-error.c",
142    "//third_party/libuv/test/test-tcp-connect-timeout.c",
143    "//third_party/libuv/test/test-tcp-connect6-error.c",
144    "//third_party/libuv/test/test-tcp-create-socket-early.c",
145    "//third_party/libuv/test/test-tcp-flags.c",
146    "//third_party/libuv/test/test-tcp-oob.c",
147    "//third_party/libuv/test/test-tcp-open.c",
148    "//third_party/libuv/test/test-tcp-rst.c",
149
150    #    "//third_party/libuv/test/test-metrics-idle-time.c",
151    #    "//third_party/libuv/test/test-metrics-idle-time-thread.c",
152    #    "//third_party/libuv/test/test-metrics-idle-time-zero.c",
153    "//third_party/libuv/test/test-tcp-read-stop-start.c",
154    "//third_party/libuv/test/test-tcp-read-stop.c",
155    "//third_party/libuv/test/test-tcp-shutdown-after-write.c",
156    "//third_party/libuv/test/test-tcp-try-write-error.c",
157    "//third_party/libuv/test/test-tcp-try-write.c",
158    "//third_party/libuv/test/test-tcp-unexpected-read.c",
159    "//third_party/libuv/test/test-tcp-write-after-connect.c",
160    "//third_party/libuv/test/test-tcp-write-fail.c",
161    "//third_party/libuv/test/test-tcp-write-queue-order.c",
162    "//third_party/libuv/test/test-tcp-write-to-half-open-connection.c",
163    "//third_party/libuv/test/test-tcp-writealot.c",
164    "//third_party/libuv/test/test-test-macros.c",
165    "//third_party/libuv/test/test-thread-equal.c",
166    "//third_party/libuv/test/test-thread.c",
167    "//third_party/libuv/test/test-threadpool-cancel.c",
168    "//third_party/libuv/test/test-threadpool.c",
169    "//third_party/libuv/test/test-timer-again.c",
170    "//third_party/libuv/test/test-timer-from-check.c",
171    "//third_party/libuv/test/test-timer.c",
172    "//third_party/libuv/test/test-tmpdir.c",
173    "//third_party/libuv/test/test-tty-duplicate-key.c",
174    "//third_party/libuv/test/test-tty-escape-sequence-processing.c",
175    "//third_party/libuv/test/test-tty.c",
176    "//third_party/libuv/test/test-udp-alloc-cb-fail.c",
177    "//third_party/libuv/test/test-udp-bind.c",
178    "//third_party/libuv/test/test-udp-connect.c",
179    "//third_party/libuv/test/test-udp-connect6.c",
180    "//third_party/libuv/test/test-udp-create-socket-early.c",
181    "//third_party/libuv/test/test-udp-dgram-too-big.c",
182    "//third_party/libuv/test/test-udp-ipv6.c",
183    "//third_party/libuv/test/test-udp-mmsg.c",
184    "//third_party/libuv/test/test-udp-multicast-interface.c",
185    "//third_party/libuv/test/test-udp-multicast-interface6.c",
186    "//third_party/libuv/test/test-udp-multicast-join.c",
187    "//third_party/libuv/test/test-udp-multicast-join6.c",
188    "//third_party/libuv/test/test-udp-multicast-ttl.c",
189    "//third_party/libuv/test/test-udp-open.c",
190    "//third_party/libuv/test/test-udp-options.c",
191    "//third_party/libuv/test/test-udp-send-and-recv.c",
192    "//third_party/libuv/test/test-udp-send-hang-loop.c",
193    "//third_party/libuv/test/test-udp-send-immediate.c",
194    "//third_party/libuv/test/test-udp-send-unreachable.c",
195    "//third_party/libuv/test/test-udp-sendmmsg-error.c",
196    "//third_party/libuv/test/test-udp-try-send.c",
197    "//third_party/libuv/test/test-uname.c",
198    "//third_party/libuv/test/test-walk-handles.c",
199    "//third_party/libuv/test/test-watcher-cross-stop.c",
200  ]
201  deps = [ "//third_party/libuv:uv_static" ]
202}
203
204ohos_executable("libuvruntest") {
205  include_dirs = [
206    "//third_party/libuv/include",
207    "//third_party/libuv/src",
208    "//third_party/libuv/src/unix",
209  ]
210  sources = [ "//third_party/libuv/test/run-tests.c" ]
211  external_deps = [ "hilog:libhilog" ]
212  deps = [ ":libuvTestStatic" ]
213  part_name = "libuv"
214  subsystem_name = "thirdparty"
215}
216
217ohos_moduletest_suite("ActsLibuvTest") {
218  sources = [ "src/ActsLibuvTest.cpp" ]
219
220  include_dirs = [
221    "../src",
222    "//third_party/libuv/test",
223    "//third_party/libuv/include",
224    "//third_party/libuv/src",
225    "//third_party/libuv/src/unix",
226  ]
227  external_deps = [ "hilog:libhilog" ]
228  deps = [ ":libuvTestStatic" ]
229  cflags = [ "-Wno-error" ]
230}
231
232ohos_sh_assist_suite("cpLibuv") {
233  testonly = true
234  script = "cplibuv.sh"
235  outputs = [ "${target_out_dir}/cplibuv.log" ]
236  root_libuv_path = rebase_path("//")
237  args = [ "$root_libuv_path" ]
238  deps = [
239    ":ActsLibuvTest",
240    ":libuvruntest",
241  ]
242  part_name = "libuv"
243}
244
245group("libuvTest") {
246  testonly = true
247  if (is_standard_system) {
248    deps = [
249      ":ActsLibuvTest",
250      ":cpLibuv",
251    ]
252  }
253}
254