aboutsummaryrefslogtreecommitdiff
path: root/test/functional/fixtures/tty-test.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-12-07 23:55:18 +0100
committerGitHub <noreply@github.com>2016-12-07 23:55:18 +0100
commitff99cbfc0273bb9f714c32a62ec02b888c196a2e (patch)
treebbfb82885565dc382721716f3d550a259852ad28 /test/functional/fixtures/tty-test.c
parent8da23cb919e55825bc89f0ebfcebcc07374d9d18 (diff)
parent933c873cae64d3840bb0539b51a983a240eeff28 (diff)
downloadrneovim-ff99cbfc0273bb9f714c32a62ec02b888c196a2e.tar.gz
rneovim-ff99cbfc0273bb9f714c32a62ec02b888c196a2e.tar.bz2
rneovim-ff99cbfc0273bb9f714c32a62ec02b888c196a2e.zip
Merge #5488 from justinmk/test-fix-mouse-drag
test: Disable unreliable test on travis+ASAN_UBSAN
Diffstat (limited to 'test/functional/fixtures/tty-test.c')
-rw-r--r--test/functional/fixtures/tty-test.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c
index ca905ce65e..778e7f3cd3 100644
--- a/test/functional/fixtures/tty-test.c
+++ b/test/functional/fixtures/tty-test.c
@@ -32,11 +32,21 @@ static void walk_cb(uv_handle_t *handle, void *arg) {
}
#ifndef WIN32
-static void sigwinch_handler(int signum)
+static void sig_handler(int signum)
{
- int width, height;
- uv_tty_get_winsize(&tty, &width, &height);
- fprintf(stderr, "rows: %d, cols: %d\n", height, width);
+ switch(signum) {
+ case SIGWINCH: {
+ int width, height;
+ uv_tty_get_winsize(&tty, &width, &height);
+ fprintf(stderr, "rows: %d, cols: %d\n", height, width);
+ return;
+ }
+ case SIGHUP:
+ exit(42); // arbitrary exit code to test against
+ return;
+ default:
+ return;
+ }
}
#endif
@@ -141,7 +151,8 @@ int main(int argc, char **argv)
struct sigaction sa;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
- sa.sa_handler = sigwinch_handler;
+ sa.sa_handler = sig_handler;
+ sigaction(SIGHUP, &sa, NULL);
sigaction(SIGWINCH, &sa, NULL);
// uv_signal_t sigwinch_watcher;
// uv_signal_init(uv_default_loop(), &sigwinch_watcher);
@@ -150,5 +161,8 @@ int main(int argc, char **argv)
#endif
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
+ // XXX: Without this the SIGHUP handler is skipped on some systems.
+ sleep(100);
+
return 0;
}