Commit Graph

571 Commits

Author SHA1 Message Date
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
Bert Belder
1d942e2ad4 Merge branch 'v0.6' 2012-02-13 20:02:39 +01:00
Bert Belder
bc8b99097a win: add ERROR_FILENAME_EXCED_RANGE mapping, fix fs_file_nametoolong test 2012-02-13 20:01:36 +01:00
Ben Noordhuis
4e1f2b1f64 Merge remote-tracking branch 'origin/v0.6' 2012-02-12 16:10:05 +01:00
Ben Noordhuis
c5aa86bd39 Remove uv_import() and uv_export().
Not needed anymore now that support for isolates has been removed from Node.

This commit reverts the following commits:

  812e410 test: fix up stream import/export test
  e34dc13 unix: implement uv_import() and uv_export()
  d1a0e8e test: fix undefined macro error
  2ce0058 import/export streams accross loops
2012-02-12 15:49:54 +01:00
Igor Zinkovsky
f9be43a564 support half-duplex pipes 2012-02-09 13:33:15 -08:00
Igor Zinkovsky
53eb9935cb fix windows build 2012-02-09 13:15:37 -08:00
Roman Shtylman
9fa2cf2eac test: add multicast TTL test 2012-02-06 15:02:39 +01:00
Maciej Małecki
0596c59bc3 test: test if UV_ELOOP mapping works 2012-02-03 22:20:14 +01:00
Bert Belder
267e75dda2 Windows: better stat implementation 2012-02-02 17:03:40 +01:00
isaacs
243cfcd078 Merge remote-tracking branch 'ry/v0.6' 2012-01-31 18:00:59 -08:00
Brandon Philips
4cfda74de4 uv.h: add EPERM to errno map to fix regression
EPERM isn't mapped in so chown returns an unknown error. This is a
regression from 0.4.12.

philips:node/ (master*) $ cat chown.js
var fs = require('fs')
fs.chown("/tmp/foobar", 100, 100, function(er){ console.log(er);})

philips:node/ (master*) $ ls -la /tmp/foobar
total 0
drwxr-xr-x   2 root  wheel   68 Jan 24 17:21 .

0.4
---

philips:node/ (master*) $ /usr/local/Cellar/node/0.4.12/bin/node chown.js
{ stack: [Getter/Setter],
  arguments: undefined,
  type: undefined,
  message: 'EPERM, Operation not permitted \'/tmp/foobar\'',
  errno: 1,
  code: 'EPERM',
  path: '/tmp/foobar' }

master
------

philips:node/ (master*) $ ./node chown.js
{ [Error: UNKNOWN, unknown error '/tmp/foobar'] errno: -1, code: 'UNKNOWN', path: '/tmp/foobar' }

AFTER
-----

philips:node/ (master*) $ ./node chown.js
{ [Error: EPERM, operation not permitted '/tmp/foobar'] errno: 49, code: 'EPERM', path: '/tmp/foobar' }
2012-01-31 16:37:26 -08:00
Bert Belder
8c8e6532bf test-multicast-join: don't attempt to bind to a multicast address
Does not work on Windows. Bind to a normal interface first, then join the
multicast group instead.
2012-01-31 17:29:21 +01:00
Ben Noordhuis
cd16ba5186 test: add UDP broadcast/multicast/ttl tests 2012-01-31 16:52:27 +01:00
Ben Noordhuis
812e410772 test: fix up stream import/export test 2012-01-30 21:45:04 +01:00
Ben Noordhuis
d1a0e8e7e2 test: fix undefined macro error 2012-01-30 21:44:27 +01:00
Igor Zinkovsky
2ce0058251 import/export streams accross loops 2012-01-30 21:44:27 +01:00
Ben Noordhuis
f9b478cfd8 test: add windows-only uv_fs_stat regression test 2012-01-28 16:52:46 +01:00
Ben Noordhuis
3de0411591 Merge remote-tracking branch 'origin/v0.6' 2012-01-27 22:23:26 +01:00
Ben Noordhuis
3f1bad2050 test: add missing return statement in fs_stat_root 2012-01-27 22:10:20 +01:00
Bert Belder
92b260c065 windows: fix stat("c:\\") regression 2012-01-27 22:09:55 +01:00
Bert Belder
f9252750e7 Fix windows build 2012-01-27 16:29:57 +01:00
Maciej Małecki
24e6c7ec86 unix: map ENAMETOOLONG to UV_ENAMETOOLONG
With tests. Closes #295
2012-01-23 19:33:09 +01:00
Ben Noordhuis
bf8ccfce18 unix: fix segfault in uv_guess_handle()
Fixes #293.
2012-01-17 17:47:33 +01:00
Ben Noordhuis
ac218a7ed5 test: add lots of refcount tests 2012-01-14 00:22:20 +01:00
Ben Noordhuis
dc3b80a50f test: add udp4_echo_server helper 2012-01-14 00:11:43 +01:00
Ben Noordhuis
38fc6ad839 unix: unref fs event watcher
Watchers were being ref-counted twice which wasn't harmful in itself but stopped
uv_unref() from working like you'd expect it to.
2012-01-02 10:42:27 +01:00
Igor Zinkovsky
43e3ac5798 windows: uv_fs_rename to replace the new file if it exists
fixes #283
2011-12-30 15:48:22 -08:00
Shigeki Ohtsu
ba52023ef3 Fix missing increments of loop->counters 2011-12-12 18:01:26 +01:00
Maciej Małecki
b06da4cbab test: make test runner return non-zero in case of failure 2011-12-12 02:08:28 +01:00
Igor Zinkovsky
dceb3e65ca uv_cwd + uv_chdir 2011-12-01 12:27:12 -08:00
Bruce Mitchener
d513d9bb41 Fix typos. 2011-11-30 14:35:13 +01:00
Ben Noordhuis
2bd181a8d2 unix: properly disarm kqueue fs watcher
Fixes "Assertion failed: (revents == EV_LIBUV_KQUEUE_HACK),
function uv__fs_event, file ../src/unix/kqueue.c, line 58."
2011-11-18 01:40:11 +01:00
Ben Noordhuis
d4bfcc28c8 bench: fix compiler warnings 2011-11-11 18:52:34 +01:00
Ben Noordhuis
e2a794e346 test: remove dead code 2011-11-11 18:52:04 +01:00
Igor Zinkovsky
f17d4837a8 windows: turn WSAECONNABORTED from WSARecv to UV_ECONNRESET 2011-11-09 14:57:41 -08:00
Tj Holowaychuk
a378110f9e Add UV_ESRCH
Fixes #239.
2011-11-08 16:36:20 -08:00
Igor Zinkovsky
f1859eb841 windows: convert WSAECONNABORTED to EOF 2011-11-07 16:53:27 -08:00
Ben Noordhuis
c468e2ab88 test: fix memory buffer comparison 2011-11-05 03:09:12 +01:00
Ben Noordhuis
9dc67f5e61 test: don't use _O_RDWR, windows-ism 2011-11-05 03:07:36 +01:00
Bert Belder
1997e10b50 Add flags to uv_fs_event_init 2011-11-05 01:42:08 +01:00
Igor Zinkovsky
faca1402ef make uv_pipe_connect return void 2011-11-04 16:06:53 -07:00
Igor Zinkovsky
fe97c4dc63 windows: honor O_APPEND in uv_fs_open 2011-11-04 12:41:23 -07:00
Ryan Dahl
681bd290e6 UV_EACCESS -> UV_EACCES
In order to match existing Node API. See
https://github.com/joyent/node/pull/2001
2011-11-03 16:17:12 -07:00
Ryan Dahl
0698e3f905 Fix UNIX pipe connect error reporting, add test 2011-11-03 15:47:43 -07:00
Igor Zinkovsky
0fb3769586 windows: don't emit fs-event callback after uv_fs_event handle is closed 2011-11-02 19:10:04 -07:00
Igor Zinkovsky
74b49e821b uv_kill 2011-11-02 14:34:07 -07:00
Igor Zinkovsky
9c6103a479 windows: add tests for uv_tcp_simultaneous_accepts 2011-11-01 01:13:13 -07:00
Igor Zinkovsky
314d0ee4f6 windows: don't fail uv_listen with UV_EALREADY if already listening. fixes #227. 2011-10-26 13:48:53 -07:00
Ben Noordhuis
339a1ad252 test: fix warning: implicit declaration of function ‘memcmp’ 2011-10-26 17:12:05 +02: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
Ben Noordhuis
ec825ffc62 unix: add TCP keepalive and no-delay control knobs 2011-10-21 16:08:26 -07:00
Ben Noordhuis
d396799210 Change return type of uv_get_*_memory() functions
... from double to uint64_t. Limit use of floating point in public API as much
as possible.
2011-10-21 10:09:59 -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
2216d38c29 windows: enable uv_fs_open to open directories 2011-10-12 10:42:41 -07:00
Ben Noordhuis
25a177a2e5 test: assert that readdir on file raises UV_ENOTDIR 2011-10-12 16:43:33 +02:00
Ben Noordhuis
e0a4e72640 sunos: look up free memory with sysconf(_SC_AVPHYS_PAGES) 2011-10-12 00:27:30 +00:00
Ben Noordhuis
7b01ad1685 test: don't assert that total_mem > free_mem
Assertion fails when running in a resource container, like a Solaris zone.
The total reported is the container's hard limit, the free memory that of
the whole system.
2011-10-11 23:49:02 +00:00
Ben Noordhuis
acc98ca922 test: uv_process_kill(proc, 0) should not kill the process 2011-10-11 21:36:54 +02:00
Roman Shtylman
a3d1f6fd6f add uv_udp_set_membership for unix multicast support
- test-udp-multicast-join tests that multicast packets can be received
- stub src/win/udp.c until support added
2011-10-11 21:25:20 +02:00
Ryan Dahl
5656e3c8bd Prepare for writable TTY to be blocking 2011-10-10 13:25:46 -07:00
Ben Noordhuis
41e8574920 unix: don't alloc memory for readdir on empty dir 2011-10-10 16:27:55 +02:00
Ben Noordhuis
04b356ab37 test: fix compiler warnings 2011-10-10 16:07:46 +02:00
Igor Zinkovsky
9f6024a6fa windows: fixes crash in pipe.c 2011-10-07 15:05:01 -07:00
Igor Zinkovsky
0364809fb5 fix fs_utime & fs_futime tests on windows 2011-10-06 16:25:59 -07:00
Ryan Dahl
60c639fd57 Merge branch 'ipc2' 2011-10-06 10:18:13 -07:00
Igor Zinkovsky
81c4043c83 ipc on windows 2011-10-06 10:17:42 -07:00
Ryan Dahl
c920db9fd1 unix: handle passing kind of working 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
27262134cd bench: add batched TCP writes benchmark
Times how long it takes to queue and write out 1,000,000 short strings.
2011-10-06 03:31:58 +02:00
Ben Noordhuis
c7870465aa error reporting: return sensible messages for synthetic errors 2011-10-06 01:17:46 +02:00
Erick Tryzelaar
e3f2631127 unix: bad connect addresses should error with EINVAL 2011-10-04 16:46:39 -07:00
Ben Noordhuis
8e9a3384c9 unix: implement kqueue file watcher API
kqueue fds are not embeddable into other pollsets (select, poll, kqueue).
Hack the libev event loop to receive kqueue events with filter flags intact.
2011-10-04 23:28:36 +02:00
Fedor Indutny
a35591bbfc os: implement loadavg (not working on cygwin/win) 2011-10-04 18:15:14 +02:00
Fedor Indutny
33cb8775bc os: implement memory bindings
* us_get_free_memory
* us_get_total_memory
2011-10-04 18:10:35 +02:00
Ben Noordhuis
6221904013 sunos: fix gyp build 2011-10-02 00:14:44 +00:00
Ryan Dahl
153d3c7c57 unix: allow tty raw mode to be turned off 2011-09-30 11:21:51 -07:00
Igor Zinkovsky
c9ae7a6f95 windows: don't strip the trailing slash from filename if it follows a device name 2011-09-28 12:59:39 -07:00
Igor Zinkovsky
4fb120f649 windows: fix error reporting for uv_fs_ functions 2011-09-28 12:46:37 -07:00
Bert Belder
1d3b880e2f Add uv_tty_t size to benchmark-sizes 2011-09-28 03:43:28 +02:00
Ben Noordhuis
517bfc8902 Merge branch 'v0.6' 2012-01-19 16:22:21 +01:00
Ben Noordhuis
dd7e6f0163 test: don't use malloc/free in test-timer 2012-01-18 19:00:55 +01:00
Ben Noordhuis
6ede034a7e test: #include missing <string.h> 2012-01-18 15:56:43 +01: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
Igor Zinkovsky
52511b9ddc windows: implement uv_loop_new+uv_loop_delete 2012-01-16 17:07:49 -08:00
Igor Zinkovsky
f5bd21f181 conform to ANSI C 2012-01-16 13:52:45 -08:00
Ben Noordhuis
71f6c0edb8 Merge remote-tracking branch 'origin/v0.6'
Conflicts:
	src/win/util.c
2012-01-16 18:07:49 +01:00
Fedor Indutny
e7758e126f unix: remove eio_set_max_poll_reqs
* added test
2012-01-16 14:49:13 +01:00
Igor Zinkovsky
26512731e3 remove uv_thread_self 2012-01-13 17:24:30 -08:00
Ryan Dahl
51ea46de45 Merge remote branch 'origin/v0.6' 2012-01-09 11:31:13 -08:00
Ryan Dahl
4ad33e9748 Revert "Add uv_pipe_pair for communication between threads"
Not needed. We took a different approach for isolates.

This reverts commit 5cc6090fdf.
2012-01-09 11:22:46 -08:00
Ryan Dahl
5cc6090fdf Add uv_pipe_pair for communication between threads
This is only the Unix implementation and test.
2011-12-29 22:41:08 -08:00
Ben Noordhuis
d6a06b8689 test: eio callbacks should run in their owning threads 2011-12-22 03:42:54 +01:00
Ryan Dahl
a993329c02 add uv_thread_self 2011-12-20 11:34:18 -08:00
Igor Zinkovsky
3d189de699 platform api 2011-12-14 17:50:36 -08:00
mattn
e53cecb8c0 add uv_run_once() 2011-12-14 14:28:35 +01:00
Ben Noordhuis
4c6008f488 Merge branch 'v0.6'
Conflicts:
	test/test-list.h
2011-12-12 18:04:17 +01:00