Commit Graph

21 Commits

Author SHA1 Message Date
Imran Iqbal
f5796d2fba test: fix test/test-tty.c for AIX
'/dev/random' causes 'isatty()' to return 1 on AIX[1]. This causes
an issue where 'dev/tty' is opened (hard coded in
src/unix/tty.c:uv_tty_init). Tried to replace the hardcoded value with
what is returned by 'ttyname()' but on AIX all that is returned is
'/dev/'.

This seems to be a bug with the AIX kernel.

[1]http://goo.gl/wGa7mf

PR-URL: https://github.com/libuv/libuv/pull/624
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-11-24 21:54:48 +01: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
Saúl Ibarra Corretgé
34da61b351 test: fix tty_file, close handle if initialized
If the handle is closed when it wasn't initialized, uv_close will fail.

PR-URL: https://github.com/libuv/libuv/pull/279
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-20 16:13:01 +01:00
Ben Noordhuis
fc9e66e555 unix: reject non-tty fds in uv_tty_init()
Reject file descriptors that correspond to regular files or char/block
devices.  Such file descriptors are incompatible with epoll and trigger
a run-time assert.

Fixes: https://github.com/libuv/libuv/issues/255
PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:51 +01:00
Ben Noordhuis
1df46fe478 unix: don't clobber errno in uv_tty_reset_mode()
uv_tty_reset_mode() is designed to be async signal-safe and is therefore
not allowed to clobber errno.

PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:50 +01:00
Ben Noordhuis
25d4abbabb test: use UV_TTY_MODE_* values in tty test
The UV_TTY_MODE_* enumeration values were introduced in commit 025602d
("tty: implement binary I/O terminal mode") but the test was not updated
to use them.  This commit rectifies that.

PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:48 +01:00
Saúl Ibarra Corretgé
e157dc9c67 test: skip tty test if detected width and height are 0
This happens in certain build environments such as Jenkins if
some tweaking is not performed in the host system.

PR-URL: https://github.com/libuv/libuv/pull/22
2014-12-02 23:57:06 +01:00
Luca Bruno
6462eaf4dc test: relax TTY availability assumptions
test-tty.c currently assumes that a TTY is available to the test runner,
and fails hard if not. This may not be true on some autobuilding
environment, making the build fail as shown in [0].
Instead, let's properly skip the test in such cases.

[0] http://ur1.ca/fr5bd

Signed-off-by: Luca Bruno <lucab@debian.org>
2013-10-08 16:26:04 +02:00
Ben Noordhuis
6607e70253 test: open stdout fd in write-only mode
Fixes #771.
2013-06-18 23:53:03 +02:00
Miroslav Bajtoš
fe2a3150c0 test: add error logging to tty unit test 2013-05-08 17:20:20 -07:00
Ben Noordhuis
4ba03ddd56 unix, windows: rename uv_run2 to uv_run
This changes the prototype of uv_run() from:

  int uv_run(uv_loop_t* loop);

To:

  int uv_run(uv_loop_t* loop, uv_run_mode mode);

Where `mode` is UV_RUN_DEFAULT, UV_RUN_ONCE or UV_RUN_NOWAIT.

Fixes #683.
2013-01-16 23:35:29 +01:00
Bert Belder
47eb03490a test: move loop cleanup code to the individual tests 2012-10-17 01:24:49 +02:00
Ben Noordhuis
8c78cb40ff unix: replace C99/C++ comments, fix build 2012-03-09 09:15:43 -08:00
Bert Belder
e53d7e3a11 Make test-tty pass with redirected stdio 2012-03-08 17:02:05 +01:00
Ben Noordhuis
bf8ccfce18 unix: fix segfault in uv_guess_handle()
Fixes #293.
2012-01-17 17:47:33 +01:00
Bruce Mitchener
d513d9bb41 Fix typos. 2011-11-30 14:35:13 +01:00
Ryan Dahl
5656e3c8bd Prepare for writable TTY to be blocking 2011-10-10 13:25:46 -07:00
Ryan Dahl
153d3c7c57 unix: allow tty raw mode to be turned off 2011-09-30 11:21:51 -07:00
Ryan Dahl
03d0c57ea2 Remove uv_is_tty. Use uv_guess_handle instead. 2011-09-23 10:01:45 -07:00
Ryan Dahl
03652596cf unix: add uv_guess_handle and uv_tty_get_winsize 2011-09-22 19:35:46 -07:00
Ryan Dahl
c1374ba587 Add uv_is_tty() 2011-09-20 11:48:47 -07:00