summaryrefslogtreecommitdiff
path: root/deps/uv/test
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <saghul@gmail.com>2014-12-09 21:01:35 +0100
committerTrevor Norris <trev.norris@gmail.com>2014-12-09 17:03:50 -0800
commit20a7088d9c62c43fedf9ab077fbbeae92c7e6617 (patch)
treecd62507bde03fff1e59de67338f2b406d2221bdd /deps/uv/test
parent4dc660e164417e0a1bc86eadd825b41d7abb053f (diff)
downloadandroid-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.tar.gz
android-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.tar.bz2
android-node-v8-20a7088d9c62c43fedf9ab077fbbeae92c7e6617.zip
deps: update libuv to 1.0.2
PR-URL: https://github.com/joyent/node/pull/8847 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'deps/uv/test')
-rw-r--r--deps/uv/test/run-benchmarks.c7
-rw-r--r--deps/uv/test/run-tests.c7
-rw-r--r--deps/uv/test/runner-unix.c13
-rw-r--r--deps/uv/test/runner-win.c4
-rw-r--r--deps/uv/test/runner.c2
-rw-r--r--deps/uv/test/runner.h10
-rw-r--r--deps/uv/test/test-osx-select.c2
-rw-r--r--deps/uv/test/test-pipe-close-stdout-read-stdin.c6
-rw-r--r--deps/uv/test/test-tty.c7
9 files changed, 44 insertions, 14 deletions
diff --git a/deps/uv/test/run-benchmarks.c b/deps/uv/test/run-benchmarks.c
index 61f062f99a..8d4f549799 100644
--- a/deps/uv/test/run-benchmarks.c
+++ b/deps/uv/test/run-benchmarks.c
@@ -33,7 +33,8 @@ static int maybe_run_test(int argc, char **argv);
int main(int argc, char **argv) {
- platform_init(argc, argv);
+ if (platform_init(argc, argv))
+ return EXIT_FAILURE;
switch (argc) {
case 1: return run_tests(1);
@@ -41,8 +42,10 @@ int main(int argc, char **argv) {
case 3: return run_test_part(argv[1], argv[2]);
default:
LOGF("Too many arguments.\n");
- return 1;
+ return EXIT_FAILURE;
}
+
+ return EXIT_SUCCESS;
}
diff --git a/deps/uv/test/run-tests.c b/deps/uv/test/run-tests.c
index d8f3cda540..e92c93008e 100644
--- a/deps/uv/test/run-tests.c
+++ b/deps/uv/test/run-tests.c
@@ -46,7 +46,8 @@ static int maybe_run_test(int argc, char **argv);
int main(int argc, char **argv) {
- platform_init(argc, argv);
+ if (platform_init(argc, argv))
+ return EXIT_FAILURE;
argv = uv_setup_args(argc, argv);
@@ -56,8 +57,10 @@ int main(int argc, char **argv) {
case 3: return run_test_part(argv[1], argv[2]);
default:
LOGF("Too many arguments.\n");
- return 1;
+ return EXIT_FAILURE;
}
+
+ return EXIT_SUCCESS;
}
diff --git a/deps/uv/test/runner-unix.c b/deps/uv/test/runner-unix.c
index 9afcd1e488..1f12c6f12d 100644
--- a/deps/uv/test/runner-unix.c
+++ b/deps/uv/test/runner-unix.c
@@ -22,10 +22,11 @@
#include "runner-unix.h"
#include "runner.h"
+#include <limits.h>
#include <stdint.h> /* uintptr_t */
#include <errno.h>
-#include <unistd.h> /* usleep */
+#include <unistd.h> /* readlink, usleep */
#include <string.h> /* strdup */
#include <stdio.h>
#include <stdlib.h>
@@ -40,7 +41,7 @@
/* Do platform-specific initialization. */
-void platform_init(int argc, char **argv) {
+int platform_init(int argc, char **argv) {
const char* tap;
tap = getenv("UV_TAP_OUTPUT");
@@ -49,8 +50,14 @@ void platform_init(int argc, char **argv) {
/* Disable stdio output buffering. */
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
- strncpy(executable_path, argv[0], sizeof(executable_path) - 1);
signal(SIGPIPE, SIG_IGN);
+
+ if (realpath(argv[0], executable_path) == NULL) {
+ perror("realpath");
+ return -1;
+ }
+
+ return 0;
}
diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c
index 83d76783f6..97ef7599eb 100644
--- a/deps/uv/test/runner-win.c
+++ b/deps/uv/test/runner-win.c
@@ -43,7 +43,7 @@
/* Do platform-specific initialization. */
-void platform_init(int argc, char **argv) {
+int platform_init(int argc, char **argv) {
const char* tap;
tap = getenv("UV_TAP_OUTPUT");
@@ -66,6 +66,8 @@ void platform_init(int argc, char **argv) {
setvbuf(stderr, NULL, _IONBF, 0);
strcpy(executable_path, argv[0]);
+
+ return 0;
}
diff --git a/deps/uv/test/runner.c b/deps/uv/test/runner.c
index a934b24c6e..e896d43b76 100644
--- a/deps/uv/test/runner.c
+++ b/deps/uv/test/runner.c
@@ -26,7 +26,7 @@
#include "task.h"
#include "uv.h"
-char executable_path[PATHMAX] = { '\0' };
+char executable_path[sizeof(executable_path)];
int tap_output = 0;
diff --git a/deps/uv/test/runner.h b/deps/uv/test/runner.h
index 97c7312da7..78f3c880a9 100644
--- a/deps/uv/test/runner.h
+++ b/deps/uv/test/runner.h
@@ -22,6 +22,7 @@
#ifndef RUNNER_H_
#define RUNNER_H_
+#include <limits.h> /* PATH_MAX */
#include <stdio.h> /* FILE */
@@ -83,8 +84,11 @@ typedef struct {
#define TEST_HELPER HELPER_ENTRY
#define BENCHMARK_HELPER HELPER_ENTRY
-#define PATHMAX 1024
-extern char executable_path[PATHMAX];
+#ifdef PATH_MAX
+extern char executable_path[PATH_MAX];
+#else
+extern char executable_path[4096];
+#endif
/*
* Include platform-dependent definitions
@@ -130,7 +134,7 @@ void print_tests(FILE* stream);
*/
/* Do platform-specific initialization. */
-void platform_init(int argc, char** argv);
+int platform_init(int argc, char** argv);
/* Invoke "argv[0] test-name [test-part]". Store process info in *p. */
/* Make sure that all stdio output of the processes is buffered up. */
diff --git a/deps/uv/test/test-osx-select.c b/deps/uv/test/test-osx-select.c
index 68e5a84167..49b1bb8229 100644
--- a/deps/uv/test/test-osx-select.c
+++ b/deps/uv/test/test-osx-select.c
@@ -90,6 +90,8 @@ TEST_IMPL(osx_select_many_fds) {
uv_tty_t tty;
uv_tcp_t tcps[1500];
+ TEST_FILE_LIMIT(ARRAY_SIZE(tcps) + 2);
+
r = uv_ip4_addr("127.0.0.1", 0, &addr);
ASSERT(r == 0);
diff --git a/deps/uv/test/test-pipe-close-stdout-read-stdin.c b/deps/uv/test/test-pipe-close-stdout-read-stdin.c
index 26a1ee76c9..3064babf98 100644
--- a/deps/uv/test/test-pipe-close-stdout-read-stdin.c
+++ b/deps/uv/test/test-pipe-close-stdout-read-stdin.c
@@ -54,7 +54,8 @@ TEST_IMPL(pipe_close_stdout_read_stdin) {
int fd[2];
int status;
- pipe(fd);
+ r = pipe(fd);
+ ASSERT(r == 0);
if ((pid = fork()) == 0) {
/*
@@ -63,7 +64,8 @@ TEST_IMPL(pipe_close_stdout_read_stdin) {
*/
close(fd[1]);
close(0);
- dup(fd[0]);
+ r = dup(fd[0]);
+ ASSERT(r != -1);
/* Create a stream that reads from the pipe. */
uv_pipe_t stdin_pipe;
diff --git a/deps/uv/test/test-tty.c b/deps/uv/test/test-tty.c
index fb69910732..7e1ce26688 100644
--- a/deps/uv/test/test-tty.c
+++ b/deps/uv/test/test-tty.c
@@ -96,6 +96,13 @@ TEST_IMPL(tty) {
printf("width=%d height=%d\n", width, height);
+ if (width == 0 && height == 0) {
+ /* Some environments such as containers or Jenkins behave like this
+ * sometimes */
+ MAKE_VALGRIND_HAPPY();
+ return TEST_SKIP;
+ }
+
/*
* Is it a safe assumption that most people have terminals larger than
* 10x10?