Commit Graph

571 Commits

Author SHA1 Message Date
Bert Belder
0dff0e7d47 test: avoid compiler warnings due to size_t truncation 2012-06-04 18:04:49 +02:00
Ben Noordhuis
d08070435d test: rename test tcp_dont_connect_after_write
Rename test tcp_dont_connect_after_write to tcp_connect_error_after_write,
teensy tad more descriptive.
2012-06-04 17:35:56 +02:00
Ben Noordhuis
76fa163117 test: add a 'write before connect' test 2012-06-04 17:12:20 +02:00
Ben Noordhuis
97801c6315 test: disable tcp_dont_connect_after_write on windows
For now. See #444.
2012-06-04 16:07:50 +02:00
Ben Noordhuis
b96ed68f46 test: add TCP connect error + write test
Original test contributed by Iñaki Baz Castillo. See #443.
2012-06-04 15:58:32 +02:00
Ben Noordhuis
c76c2066c6 unix, windows: add semaphore functions 2012-06-03 04:04:05 +02:00
Ben Noordhuis
28ed730bfb test: fix implicit function declaration warnings
Fixes the two following compiler warnings:

  ../test/run-tests.c: In function ‘maybe_run_test’:
  ../test/run-tests.c:117: warning: implicit declaration of function ‘write’
  ../test/run-tests.c:118: warning: implicit declaration of function ‘fsync’
2012-06-03 01:17:24 +02:00
Fedor Indutny
1cd9642cbb test: stdin/out/err should be set to /dev/null when ignored 2012-06-02 21:38:39 +02:00
Bert Belder
4a07b8b7bd test-poll: make spurious wakeup detection slightly less strict 2012-06-02 21:12:10 +02:00
Bert Belder
38a6f9f0d9 test: fix windows-ism in test-poll-close.c 2012-06-01 18:53:11 +02:00
Bert Belder
9759c20e90 test: verify that closing an active poll handle doesn't hang 2012-06-01 18:39:47 +02:00
Bert Belder
87dbffbd8f windows: fix undefined function warning in run-tests.c 2012-06-01 17:49:29 +02:00
Fedor Indutny
dc7a62d114 test: test for uv_spawn with stdio_count == 3 2012-06-01 17:32:34 +02:00
Fedor Indutny
f5b5127db0 change spawn() api to allow using existing streams for stdio
This commit also adds support for this api on Unix.
2012-06-01 17:32:27 +02:00
Bert Belder
04a7e5c274 test-spawn.c: remove unused variable 2012-06-01 02:26:25 +02:00
Charlie McConnell
69a923bf93 process: implement UV_PROCESS_DETACHED flag for uv_spawn 2012-06-01 02:24:05 +02:00
Ben Noordhuis
3f37ba859f bench: add new idle loop count benchmark 2012-05-31 02:46:18 +02:00
Ben Noordhuis
171ad8567d unix, windows: add uv_walk()
Lets the libuv user iterate over the open handles. Mostly intended as a
debugging tool or a post-hoc cleanup mechanism.
2012-05-30 02:33:39 +02:00
Ben Noordhuis
12ee388cd9 test: clean up test-loop-handles.c 2012-05-29 17:35:30 +02:00
Ben Noordhuis
ec0c7b8958 test: fix double close in test-loop-handles.c 2012-05-29 17:35:30 +02:00
Fedor Indutny
c0081f0e66 unix: allow specifying FDs to be inherited by a child process
Previously the only option was to create a pipe or an ipc channel. This
patch makes it possible to inherit a handle that is already open in the
parent process. It also makes it possible to set more than just stdin,
stdout and stderr.
2012-05-29 00:05:12 +02:00
Igor Zinkovsky
5a34f19970 windows: allow specifying FDs to be inherited by a child process
Previously the only option was to create a pipe or an ipc channel. This
patch makes it possible to inherit a handle that is already open in the
parent process. There is also room for setting more than just stdin,
stdout and stderr, although this is not supported yet.
2012-05-28 23:59:58 +02:00
Ben Noordhuis
028fef84b8 unix: update timer if already active
uv_timer_start() no longer returns an error when the timer is already active,
now it just updates the timer. Consistent with the uv-win implementation.

Fixes #425.
2012-05-26 02:09:59 +02:00
Ben Noordhuis
ae9d4c2aab test: add 'is active?' checks to test-timer.c 2012-05-26 01:57:49 +02:00
Ben Noordhuis
34445d0741 test: remove stale UNIX socket before running test
Fixes spurious test and benchmark failures.
2012-05-26 01:42:40 +02:00
Ben Noordhuis
28766dcf55 test: remove test-eio-overflow.c
Unreliable, it's timing / system load sensitive.
2012-05-25 01:33:44 +02:00
Ben Noordhuis
890d443558 unix: shave about 100 bytes off uv_udp_send_t 2012-05-23 23:21:08 +02:00
Ben Noordhuis
b69f8efee1 test: remove stale socket in ipc_send_recv_pipe
Fixes spurious test failures.
2012-05-23 21:18:40 +02:00
Ben Noordhuis
cd2a9b4d59 bench: measure ticks per second of idle event loop 2012-05-23 21:05:43 +02:00
Ben Noordhuis
7c8313bd0f unix, windows: make uv_run_once() return a bool
The return value of uv_run_once() now signals if it needs to be called again.

Fixes #427.
2012-05-23 20:49:03 +02:00
Ben Noordhuis
3604b8ddd3 unix: don't unlink UNIX socket on EADDRINUSE
It was a bad idea to start with...
2012-05-23 14:06:32 +02:00
Ben Noordhuis
b19a713cfc test: fix unused variable warning 2012-05-23 12:51:15 +02:00
Ben Noordhuis
7a64ec49ff test: clean up test-tcp-writealot.c
Avoid unnecessary heap allocations, makes it easier to reason about correctness.
2012-05-23 01:50:10 +02:00
Bert Belder
0ef7844b87 Disable test-callback-order
It's not correct.
2012-05-22 17:13:04 +02:00
Bert Belder
25316a3f92 Make the gethostbyname benchmark more precise 2012-05-22 16:11:21 +02:00
Ben Noordhuis
a478847f74 test: add callback order test
Ensure that idle callbacks run before other callbacks.
2012-05-22 16:04:11 +02:00
Igor Zinkovsky
ea8fa31fc0 fix fs_symlink_dir test 2012-05-22 00:23:26 -07:00
Ben Noordhuis
7447048981 test: enable tcp_connect_error_fault test 2012-05-18 01:19:57 +02:00
Ben Noordhuis
538a562cdb test: add tcp connect timeout test 2012-05-18 01:19:56 +02:00
Igor Zinkovsky
60af28abab windows: support junctions with uv_fs_synlink
based on @piscisaureus implementation
2012-05-17 09:53:26 -07:00
Ben Noordhuis
9efa8b3571 unix, windows: rework reference counting scheme
This commit changes how the event loop determines if it needs to stay alive.

Previously, an internal counter was increased whenever a handle got created
and decreased again when the handle was closed.

While conceptually simple, it turned out hard to work with: you often want
to keep the event loop alive only if the handle is actually doing something.
Stopped or inactive handles were a frequent source of hanging event loops.

That's why this commit changes the reference counting scheme to a model where
a handle only references the event loop when it's active. 'Active' means
different things for different handle types, e.g.:

 * timers: ticking
 * sockets: reading, writing or listening
 * processes: always active (for now, subject to change)
 * idle, check, prepare: only active when started

This commit also changes how the uv_ref() and uv_unref() functions work: they
now operate on the level of individual handles, not the whole event loop.

The Windows implementation was done by Bert Belder.
2012-05-17 07:07:53 +02:00
Ben Noordhuis
ad024040fc test: prevent accidental division by zero 2012-05-07 16:41:05 +02:00
Bert Belder
ef9a9f1f78 Tests: make test-tcp-write-error pass on XP 2012-05-04 13:02:55 -07:00
Ben Noordhuis
5d19aa84f0 unix, win: rework uv_dlopen() API 2012-05-03 19:36:40 +02:00
Bert Belder
b9504f7987 Rename uv_platform_socket_t to uv_os_sock_t 2012-05-03 16:05:05 +02:00
Bert Belder
444ab19be8 Benchmarks: add size of uv_poll_t to benchmark-sizes 2012-05-03 15:52:57 +02:00
Bert Belder
beaf750700 Test: add tests for uv_poll 2012-05-03 15:52:57 +02:00
Erik Dubbelboer
623441685d test-spawn failed to build on linux
- added missing header file
- converted c++ style comment to c style comment
2012-04-28 23:57:59 +02:00
Bert Belder
bfd6d465c7 Test for the uv_spawn's setuid and setgid options 2012-04-28 02:39:18 +02:00
Ben Noordhuis
6c2a2aa250 test: don't assume unref'd timer cb runs 2012-04-18 02:54:57 +02:00
Ben Noordhuis
57ee146985 test: unlink UNIX socket before starting pipe echo server 2012-04-18 02:39:33 +02:00
Ben Noordhuis
976423c643 test: remove unused variable 2012-04-18 02:39:33 +02:00
Ben Noordhuis
f471f06322 test: clean up test-stdio-over-pipes 2012-04-18 02:39:30 +02:00
Ben Noordhuis
32948ab952 test: make variables static in test-gethostbyname.c 2012-04-18 02:36:56 +02:00
Ben Noordhuis
92ec798984 test: stop counter_init from failing when watch_dir exists 2012-04-18 02:36:43 +02:00
Bert Belder
20879c1cf2 test: fix a race condition in 'async' test 2012-04-18 01:28:26 +02:00
Ben Noordhuis
5345ee36f2 test: fix race conditions in test-async 2012-04-17 15:58:29 +02:00
Bert Belder
76364c26de Fix spawn_and_kill_with_std test 2012-04-13 01:59:24 +02:00
Bert Belder
4f0ff3c504 Disable ipc_send_recv_pipe test on Windows
It's not supported yet
2012-04-12 03:33:53 +02:00
Ben Noordhuis
4741a112ad test: disable fs_event_close_in_callback on kqueue-based systems 2012-04-12 02:33:14 +02:00
Bert Belder
2e5e1165ce Tests: don't use %zu placeholder in printf statements
It's not supported by msvcrt.
2012-04-11 22:54:02 +02:00
Ben Noordhuis
42d3533487 unix: fix udp_options test on OS X and Solaris
setsockopt(IP_TTL) will happily let you set a TTL > 255 on OS X, cap it.

-1 or 0 is a valid TTL on Linux but not portable, deny it.
2012-04-11 14:51:46 +00:00
Ben Noordhuis
ed395e0619 unix: replace handle->next_watcher
Remove the next_watcher and replace it with a linked list. Said list is named
endgame_handles (because the uv-win calls it that) and contains all the handles
that are in the UV_CLOSING state.

The goal of this commit is two-fold:

a) remove a dependency on libev, and
b) share more code with uv-win in the future

A nice side effect is that it shaves a few bytes off a uv_handle_t.
2012-04-04 05:22:20 -07:00
Brian White
9d3c00046f test: ensure valid uptime value 2012-04-01 21:15:51 +02:00
Vladimir Dronnikov
b309f2e2e6 Add uv_is_closing()
Closes #367.
2012-04-01 21:05:50 +02:00
Igor Zinkovsky
70925c3bb9 windows: Enable passing of TCP connections over IPC 2012-03-29 18:18:46 -07:00
Bert Belder
6e0ca3aa8f Merge branch 'v0.6'
Conflicts:
	src/unix/linux/inotify.c
2012-03-27 23:46:23 +02:00
Bert Belder
aff078390f Test: verify that uv_close from an fs event callback works properly 2012-03-27 23:00:26 +02:00
Bert Belder
732cf91d6d Test: verify that no callbacks are made after closing an fs event watcher 2012-03-27 23:00:26 +02:00
Bert Belder
89303f365e Fs event tests: don't fail if a previously failed test left stray files 2012-03-27 23:00:25 +02:00
Bert Belder
7e8fe3ece7 test-fs-event.c: style 2012-03-27 23:00:25 +02:00
Ben Noordhuis
8ce8bfaa40 test: fix format string warnings 2012-03-21 06:26:10 -07:00
Ben Noordhuis
379ca428ef test: fix compiler warnings
* remove unused variables and functions
* replace %llu with %zu when printing size_t variables
2012-03-16 02:46:51 +01:00
Ben Noordhuis
c21184c103 test: make variables in benchmark-ares static 2012-03-16 00:48:06 +01:00
Ben Noordhuis
6031156602 test: silence compiler warning
main_proc is never read without having been initialized first but gcc 4.4.x
fails to infer that.
2012-03-15 16:09:06 +01:00
Ben Noordhuis
6dcce92d44 unix: replace C99/C++ comments, fix build 2012-03-15 01:09:16 +01:00
Ben Noordhuis
8c78cb40ff unix: replace C99/C++ comments, fix build 2012-03-09 09:15:43 -08:00
Ben Noordhuis
e190162975 test: test cross-process handle send/recv 2012-03-09 09:12:53 -08:00
Bert Belder
8ffad48818 Make the thread_create benchmark not time out 2012-03-09 17:53:48 +01:00
Bert Belder
0d6aa2a2e5 Windows: output newline before output from passed tests 2012-03-09 17:15:00 +01:00
Bert Belder
e99fba47c8 Merge remote-tracking branch 'origin/v0.6'
Conflicts:
	src/win/pipe.c
	test/run-tests.c
2012-03-09 16:41:12 +01:00
Bert Belder
3aa6069abf Windows test runner: show process name instead of test name
If a test failed we would previously see:

  Output from process `test_foo`: blah
  Output from process `test_foo`: (nothing)

This commit changes it to:

  Output from process `test_foo`: blah
  Output from process `foo_helper`: (nothing)
2012-03-09 16:31:14 +01:00
Bert Belder
50216706c2 Test runner: fix compiler warnings 2012-03-09 16:31:13 +01:00
Bert Belder
f285caf0b5 Test counters_init: fix compiler warnings 2012-03-09 16:31:13 +01:00
Bert Belder
aafa7db1d4 Test benchmark_pound: fix compilation problem 2012-03-09 16:31:12 +01:00
Bert Belder
abc4f56ff0 Test chown_root: make it pass on windows 2012-03-09 16:31:11 +01:00
Bert Belder
09a0d61e7b Test cwd_and_chdir: don't chdir to "" or "c:"
It should not strip the trailing (back)slash from a root directory.
2012-03-09 16:31:02 +01:00
Bert Belder
422a898a7f Tests: verify that shutdown_cb is always called 2012-03-09 05:00:11 +01:00
Bert Belder
fb65d74c84 Tests: verify that uv_write and uv_shutdown ref the event loop 2012-03-09 05:00:11 +01:00
Bert Belder
87752ac38b Fold trailing whitespace 2012-03-09 05:00:09 +01:00
Bert Belder
e53d7e3a11 Make test-tty pass with redirected stdio 2012-03-08 17:02:05 +01:00
Bert Belder
743cab9f9d Test runner: avoid process_wait failure when the test process didn't start 2012-03-08 16:44:30 +01:00
Brandon Philips
d07f2466d0 test: fs: add tests for read EOF
This fix was merged without tests:
https://github.com/philips/libuv/tree/fix-read-on-windows-to-handle-eof

So take tests from igorzi:
46024bf33d
2012-03-07 14:33:33 +01:00
Shigeki Ohtsu
b55801f225 win, unix: add uv_dlerror() and uv_dlerror_free() 2012-03-02 16:39:21 +01:00
Igor Zinkovsky
702f905f73 test: make pipe_connect_to_file succeed with ECONNREFUSED 2012-03-01 14:32:59 -08:00
Igor Zinkovsky
6bbccf1fe0 windows: return UV_ENOTSOCK when doing uv_pipe_connect to a file 2012-03-01 12:11:29 -08:00
Ben Noordhuis
ec0eff955e Revert b3e0ad4, 149d32c, e99fdf0 and ea9baef.
Detaching doesn't work yet, the setsid() call fails and leaves the child process
attached to the parent's session.

Revert "test: Add test case for spawning detached child processes."
Revert "win: Implement options.detached for uv_spawn() for Windows."
Revert "unix: Implement options.detached for uv_spawn() for unix."
Revert "Add "detached" member to uv_process_options_t to denote whether a child
        process should spawn detached from its parent."

This reverts commit ea9baef95c.
This reverts commit e99fdf0df6.
This reverts commit 149d32cb96.
This reverts commit b3e0ad4db8.
2012-02-28 15:29:05 +01:00
Charlie McConnell
ea9baef95c test: Add test case for spawning detached child processes. 2012-02-24 15:15:00 +01:00
Ben Noordhuis
4240f0d710 test: check uv_fs_*() return values 2012-02-23 05:43:21 -08:00
Ben Noordhuis
a5082e8271 test: add proper type casts 2012-02-23 05:42:45 -08:00