Commit Graph

44 Commits

Author SHA1 Message Date
Ben Noordhuis
47dcc07cf7 win: move stdint-msvc2008.h to include/uv/
Move it so that include/ contains uv.h and nothing more.

PR-URL: https://github.com/libuv/libuv/pull/1850
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-14 18:40:09 +02:00
John Barboza
b01de7341f
zos: implement uv_fs_event* functions
This commit uses the Register File Interest feature on z/OS
to enable users to monitor file system events.
The poll call is used to check for file descriptors as well
as a message queue that z/OS will report file system events
on. The last item on the list used by poll will contain the
message queue id instead of a file descriptor.

Limitation:
Writes to a directory (that is, file creation and deletion)
do not generate a change message for a registered directory.

PR-URL: https://github.com/libuv/libuv/pull/1311
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-12-15 11:04:16 +01:00
Brad King
621655352c test: skip self-connecting tests on cygwin
The cygwin runtime library fails to connect a socket client to a
listening server within the same thread.  Test cases that use
this approach hang while waiting for the connection to complete.
This can be reproduced independent of libuv in a simple example
using both socket/bind/listen and socket/connect in a single
thread.

Avoid this problem in our test suite by skipping such tests on cygwin.

PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-21 16:12:30 +02:00
Brad King
580f032737 cygwin: disable non-functional ipc handle send
On Cygwin `recvmsg` always sets `msg_controllen` to zero on a
message received from a named pipe.  Therefore we cannot use
`sendmsg` to send handles for ipc.  Return failure early from
this code path as `ENOSYS`.

Skip tests requiring this feature since it is not available.

PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-21 16:12:28 +02:00
Brad King
6398251aff cygwin: implement support for cygwin and msys2
Cygwin and MSYS2 are POSIX layers implemented on top of Windows.
Use our POSIX `poll(2)` implementation of our poll abstraction.
For most other components we already have dedicated sources
implementing them in terms of APIs available on Cygwin or
providing non-implementations of components not supported.

This leaves only three components that need Cygwin-specific
implementations:

* uv_uptime: implement using sysinfo
* uv_resident_set_memory: add a placeholder returning UV_ENOSYS
* uv_cpu_info: add a placeholder returning UV_ENOSYS

Update our test suite to account for features not available
due to Cygwin platform limitations or our placeholders.

PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-21 16:12:21 +02:00
Brad King
f4f1f57e7c test: factor out fsevents skip explanation
Factor out a dedicated test macro for use on platforms that
do not support fsevents instead of duplicating the os390
platform condition and explanation text.

PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-05-21 16:12:08 +02:00
Ben Noordhuis
7e7e221260 test: remove unused RETURN_TODO macro
PR-URL: https://github.com/libuv/libuv/pull/898
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-06-10 10:08:15 +02:00
Nan Xiang
12548de1b5 test: assume no IPv6 if interfaces cannot be listed
PR-URL: https://github.com/libuv/libuv/pull/724
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-02-16 08:47:21 +01:00
Nan Xiang
b6650dff56 test: use uv_loop_close and assert its result
uv_loop_delete is considered deprecated.

PR-URL: https://github.com/libuv/libuv/pull/696
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2016-02-01 09:15:41 +01:00
Jeremy Whitlock
eb3f48ebaf win: do not read more from stream than available
On Windows the pipe implementation could read more from a stream than
was available and it would create an assertion failure.  This change
will make it so we read the minimum of the available data or the length
of the data.

To test this, I took the existing ipc_send_recv_tcp test and updated it
to do two writes and two read on each side of the pipe since that was the
reproduction recipe used by the reporter.  This approach reproduced the
issue on Windows and the committed fix resolved the issue.

Fixes: https://github.com/libuv/libuv/issues/505
PR-URL: https://github.com/libuv/libuv/pull/549
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-12-08 09:28:15 +01:00
Peter Jas
a59085e140 win: use the MSVC provided snprintf where possible
PR-URL: https://github.com/libuv/libuv/pull/532
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-29 09:01:33 +02:00
Peter Jas
514c0b3d06 windows: MSVC 2015 has C99 inline
Prior to MSVC 2015, the standard C99 `inline` keyword was missing,
added a compiler version check and disabled the inline replacement for
MSVC >= 2015 in test/task.h.

Refs: https://github.com/libuv/libuv/pull/341
PR-URL: https://github.com/libuv/libuv/pull/369
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-06-15 10:16:52 +02:00
Rui Abreu Ferreira
18b857b9bd windows: MSVC 2015 has snprintf()
Prior to MSVC 2015, there was no standard compliant snprintf(), added a
compiler version check and disabled the snprintf() replacement for MSVC >=
2015 in test/task.h.

PR-URL: https://github.com/libuv/libuv/pull/341
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-05-19 11:23:24 +02:00
Rui Abreu Ferreira
4a7c1268e0 windows: define snprintf replacement as inline instead of static
The MSVC compiler does not accept static methods defined in headers,
when linking against a shared library. The snprintf replacement
function used for windows, is now an inline function.

PR-URL: https://github.com/libuv/libuv/pull/329
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-04-30 10:09:50 +02:00
Saúl Ibarra Corretgé
cdc10a907a test: remove LOG and LOGF variadic macros
Initial patch by @simar7, thanks!

PR-URL: https://github.com/libuv/libuv/pull/313
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-04-12 18:44:34 +02:00
Ben Noordhuis
a09e77e180 test: skip ipv6 tests when ipv6 is not supported
To verify on Linux, run `sudo sysctl net.ipv6.conf.all.disable_ipv6=1`
before the test suite.

Fixes: https://github.com/libuv/libuv/issues/10
PR-URL: https://github.com/libuv/libuv/pull/92
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-12-29 17:14:48 +01:00
Saúl Ibarra Corretgé
96f164e52b test: silence some Clang warnings
They only show up on OSX for some reason, though.

PR-URL: https://github.com/libuv/libuv/pull/67
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-13 20:57:14 +01:00
Saúl Ibarra Corretgé
0e59136823 test: fix compiation warning
-Wunused-function would kick in because of the close_loop function,
but there tests and benchmarks which actually don't use any loop.
2014-03-03 21:49:34 +01:00
Saúl Ibarra Corretgé
e4f28adce4 test: make sure all handles in the loop are closed 2014-02-28 09:33:30 +01:00
Saúl Ibarra Corretgé
5ac214c712 unix, windows: add uv_pipe_getsockname 2014-02-23 20:25:20 +01:00
Fedor Indutny
86b5c1ef1c test: test fsevents error reporting
Create a lot of `FSEventStream`s to make `FSEventStreamStart()` fail.
Fetch the error code and verify that it is correct.
2013-11-13 18:18:56 +04:00
Sean Farrell
ee434b3069 test: remove replacement snprintf for mingw
Mingw has a proper definition of snprintf.
2013-10-25 13:01:31 +02:00
Ben Noordhuis
fd082901f1 test: add windows-only snprintf() function
Should fix the build after 96f32a2 inadvertently broke it.

There is no snprintf() on Windows because, hey, it's a C99 addition
and the people from Redmond, WA are still firmly stuck in 1989.
2013-08-05 14:14:02 +02:00
Ben Noordhuis
ddd7e04fd6 build: switch to autotools
Switch to the build tool everyone loves to hate.  The Makefile has
served us well over the years but it's been acquiring more and more
features that autotools gives us for free, like easy static+shared
library building, sane install targets, and so on.

This commit drops MinGW support.  If there is demand for it, we'll
re-add it.
2013-07-02 01:21:16 +02:00
Ben Noordhuis
ede83188f3 test: don't use S_IREAD and S_IWRITE
They're BSD-isms and obsolete ones at that. Replace with S_IRUSR and
S_IWUSR. Alias as _S_IREAD and _S_IWRITE on Windows because the '90s
never ended in Redmond, WA.
2013-05-31 12:50:19 +02:00
Miroslav Bajtoš
2c21050956 test: add RETURN_SKIP and RETURN_TODO macros
Added two new flags to identify tests that are intentionally ignored
(usually because we don't want to implement the tested functionality
on current platform) and test serving as TODO list (usually indicating
that the tested functionality should be implemented on current plaform
in the near future.)
2013-05-08 15:43:54 -07:00
Ben Noordhuis
7ff6f29b85 test, bench: ANSI-fy function prototypes
Replace `void f()` with `void f(void)`; the former means "a function
that takes any number of arguments, including none" while the latter
is what is actually intended: a function taking no arguments.

The first form also isn't strictly conforming ANSI/ISO C.
2013-01-06 22:31:48 +01:00
saghul
61ecb3415d win: support compilation with Visual Studio 2008 2012-10-23 22:55:25 +02:00
Bert Belder
47eb03490a test: move loop cleanup code to the individual tests 2012-10-17 01:24:49 +02:00
Ben Noordhuis
123ca8b87e test: make fmt() function global 2012-06-29 02:29:21 +02:00
Ben Noordhuis
5345ee36f2 test: fix race conditions in test-async 2012-04-17 15:58:29 +02:00
Ben Noordhuis
1161d31aea test: move container_of() macro into task.h 2012-01-18 15:56:40 +01:00
Ben Noordhuis
fbbc085448 Rename COUNTOF() to ARRAY_SIZE().
Consistent with Node, it has an ARRAY_SIZE() macro but not COUNTOF().
2012-01-18 15:48:31 +01:00
Ben Noordhuis
dc3b80a50f test: add udp4_echo_server helper 2012-01-14 00:11:43 +01:00
Igor Zinkovsky
54982a23ef windows: stdio over non-overlapped pipes 2011-10-20 15:14:39 -07:00
Igor Zinkovsky
afc998759f Add uv_pipe_bind tests 2011-07-21 02:25:10 +02:00
Ben Noordhuis
6c8acb0ed1 task: flush stderr after printing 2011-07-20 21:00:59 +02:00
Ben Noordhuis
4eff34da43 uv-unix: pipes API implementation
Based on UNIX sockets to avoid the vagaries of FIFOs
in asynchronous mode. Currently unlinks stale sockets
before binding and cleans them up again after shutdown.
2011-07-19 00:58:02 +02:00
Igor Zinkovsky
b6a6dae34f Named pipes implementation for Windows 2011-07-09 21:41:04 +02:00
Ryan Dahl
452681fbe9 fix port conflict 2011-05-16 17:55:11 -07:00
Ryan Dahl
2ef3c6c632 oio -> uv 2011-05-11 20:21:49 -07:00
Bert Belder
d4c5e599f3 Define API for test threading helpers 2011-05-09 05:52:04 +02:00
Bert Belder
53f9d5a841 Allow tests and benchmarks to use the same helpers.
Closes #21.
2011-04-19 14:51:10 +02:00
Bert Belder
5275b036b0 Benchmark runner 2011-04-19 04:47:21 +02:00