Commit Graph

47 Commits

Author SHA1 Message Date
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
ff29322b99 test: canonicalize test runner path
The get_currentexe test requires a canonicalized argv[0] to check
against.  Before this commit, it failed when argv[0] contained symbolic
links.

Fixes libuv/libuv#18.
2014-12-01 16:20:51 +01:00
Alexis Campailla
6d3a051eb4 windows: relay TCP bind errors via ipc
This is the libuv side of the fix for Node's cluster module on Windows.
https://github.com/joyent/node/issues/7691

Windows and Unix return certain socket errors (i.e. EADDRINUSE) at
different times: bind on Windows, and listen on Unix.
In an effort to hide this difference, libuv on Windows stores such
errors in the bind_error field of uv_tcp_t, to defer raising it at
listen time.
This worked fine except for the case in which a socket is shared in
a Node cluster and a bind error occurs.

A previous attempt to fix this (
d1e6be1460
3da36fe00e
) was flawed becaused in an attempt to relay the error at the JS level
it caused the master to start accepting connections.

With this new approach, libuv itself is relaying the bind errors,
providing for a uniform behavior of uv_tcp_listen.
2014-07-31 17:24:40 +02:00
Fedor Indutny
6abe1e4b95 fs: uv__cloexec() opened fd
Every file descriptor opened using libuv should be automatically marked
as CLOEXEC to prevent it from leaking to a child process. Note that
since we are opening fds in a thread pool, there is a possible race
condition between `uv_spawn()` and the `open()` + `uv__cloexec()`. The
rwlock was added to avoid it.

see https://github.com/joyent/node/issues/6905
2014-02-01 01:02:37 +04:00
Dylan Cali
756087e017 test: support flexibly setting custom task options
Add a single TEST_ENTRY_CUSTOM hook that can be used to override task
entry defaults. Different tests can have different timeouts depending on
what is appropriate for each test. A separate TEST_OUTPUT_ENTRY hook is
no longer necessary.

In order to support per-task timeouts, the timeout field has been moved
into the task_entry_t struct. The default (5000) is now set as part of
TEST_ENTRY.
2014-02-01 00:50:40 +04:00
Timothy J Fontaine
bfe269b8a0 test: add tap output
Given UV_TAP_OUTPUT being set, test result output should use TAP formatting
2013-02-22 23:06:17 +01:00
Ben Noordhuis
f5b6374948 test, bench: replace strlen() with sizeof() 2012-12-14 11:47:54 +01:00
Ben Noordhuis
0a05b31a93 test: fix -Wunused-result warnings 2012-12-14 11:34:17 +01:00
Charlie McConnell
1d858156b4 unix: do not set environ unless one is provided
Currently, `uv_spawn` will set `environ` to the value of `options.env`, even if
`options.env` is `NULL`.  This results in child processes for whom `environ ==
NULL`, which can cause a variety of unexpected issues.
2012-11-03 01:37:22 +01: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
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
Igor Zinkovsky
70925c3bb9 windows: Enable passing of TCP connections over IPC 2012-03-29 18:18:46 -07:00
Ben Noordhuis
e190162975 test: test cross-process handle send/recv 2012-03-09 09:12:53 -08: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
50216706c2 Test runner: fix compiler warnings 2012-03-09 16:31:13 +01:00
Bert Belder
87752ac38b Fold trailing whitespace 2012-03-09 05:00:09 +01:00
Ben Noordhuis
a5082e8271 test: add proper type casts 2012-02-23 05:42:45 -08:00
Ben Noordhuis
4e1f2b1f64 Merge remote-tracking branch 'origin/v0.6' 2012-02-12 16:10:05 +01:00
Igor Zinkovsky
f9be43a564 support half-duplex pipes 2012-02-09 13:33:15 -08:00
Igor Zinkovsky
0cb2213db0 windows: when sharing a server socket, only call listen in the parent process 2011-10-25 13:23:53 -07:00
Igor Zinkovsky
28234d7336 windows: ref pipe writes to keep the event loop alive 2011-10-20 15:14:55 -07:00
Igor Zinkovsky
54982a23ef windows: stdio over non-overlapped pipes 2011-10-20 15:14:39 -07:00
Igor Zinkovsky
81c4043c83 ipc on windows 2011-10-06 10:17:42 -07:00
Ryan Dahl
bb6b629e6a make test-ipc accept the pending tcp server 2011-10-06 10:17:18 -07:00
Ryan Dahl
dc0f17d3e3 Add server to ipc_helper 2011-10-06 10:17:18 -07:00
Ryan Dahl
6921d2fc07 Add argument to uv_pipe_init for IPC, unix impl 2011-10-06 10:17:07 -07: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
Igor Zinkovsky
3d189de699 platform api 2011-12-14 17:50:36 -08:00
Ben Noordhuis
4d7cfe4313 test: remove stale prototype declaration 2011-09-08 00:00:18 +02:00
Ben Noordhuis
7dda111306 test, bench: add --list option to runners, prints available tests 2011-08-06 23:57:28 +02:00
Ben Noordhuis
5a15717144 test: make spawn_helper4 never return
Its whole raison d'être is to sleep until it's killed.
2011-08-02 00:46:44 +02:00
Ben Noordhuis
e56c1d7a60 test: exit with status code 1 in spawn_helper4
Fixes broken test spawn_and_kill.
2011-08-01 22:42:32 +02:00
Ben Noordhuis
31ecdcf3a4 test: move run-test spawn helpers to a separate function 2011-08-01 22:42:32 +02:00
Ben Noordhuis
023f99a609 test: gets(3)? Just say no! 2011-08-01 18:14:14 +02:00
Igor Zinkovsky
d272a2183d Windows: spawn child processes 2011-07-29 19:02:51 -07:00
Ryan Dahl
ddee1821fa Add spawn_stdout test 2011-07-25 17:11:23 -07:00
Ryan Dahl
92bc7b4959 Start uv_spawn()
Unix only at the moment. Lacks test for stdio
2011-07-25 16:19:27 -04:00
Ben Noordhuis
a29b2099ac Make it possible to run individual tests.
Fixes #100.
2011-07-14 02:19:36 +02:00
Ryan Dahl
2f4e65a1b2 Port to Solaris 2011-05-10 06:53:50 +00:00
Ryan Dahl
f0de01379f Use argv[0] if we can't get_executable_path() 2011-05-09 23:12:44 -07:00
Ryan Dahl
8e1645b85f LF after tests complete 2011-05-05 00:21:13 -07:00
Ryan Dahl
8c6c48595a Make test runner better.
Probably screws up windows.
Fixes #30.
2011-04-28 15:19:11 -04:00
Ryan Dahl
b4836377f9 unix runner: implement timeout on process_wait 2011-04-25 21:54:17 -07:00
Bert Belder
c18d6649f8 Style 2011-04-22 05:09:58 +02:00
Bert Belder
5275b036b0 Benchmark runner 2011-04-19 04:47:21 +02:00