From: Luca Bruno Date: Sun, 23 Oct 2016 13:36:45 +0000 (+0100) Subject: test: skip tty_pty test if pty is not available X-Git-Tag: archive/raspbian/1.44.2-1+rpi1~1^2^2^2^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a52b55b439ed47e4b8d5c0b757bc0682d1ce058a;p=libuv1.git test: skip tty_pty test if pty is not available Reviewed-By: Colin Ihrig Reviewed-By: Saúl Ibarra Corretgé Forwarded: yes, accepted already: https://github.com/libuv/libuv/pull/919 Last-Update: Sun, 19 Jun 2016 18:20:53 +0200 Do not let `tty_pty` test fail if no terminals are available to `openpty()`. Gbp-Pq: Name skip_test_if_no_pty.patch --- diff --git a/test/test-tty.c b/test/test-tty.c index 55cc016..5787d1d 100644 --- a/test/test-tty.c +++ b/test/test-tty.c @@ -262,14 +262,17 @@ TEST_IMPL(tty_file) { TEST_IMPL(tty_pty) { # if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) || \ defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) - int master_fd, slave_fd; + int master_fd, slave_fd, r; struct winsize w; uv_loop_t loop; uv_tty_t master_tty, slave_tty; ASSERT(0 == uv_loop_init(&loop)); - ASSERT(0 == openpty(&master_fd, &slave_fd, NULL, NULL, &w)); + r = openpty(&master_fd, &slave_fd, NULL, NULL, &w); + if (r != 0) + RETURN_SKIP("No pty available, skipping."); + ASSERT(0 == uv_tty_init(&loop, &slave_tty, slave_fd, 0)); ASSERT(0 == uv_tty_init(&loop, &master_tty, master_fd, 0)); /* Check if the file descriptor was reopened. If it is,