Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename spawn helpers

  • Loading branch information...
commit f6fe38ea33efe45d570445a8d20ff476724c82f7 1 parent c0c9e37
@felixge felixge authored piscisaureus committed
Showing with 15 additions and 15 deletions.
  1. +5 −5 test/run-tests.c
  2. +4 −4 test/test-spawn-sync.c
  3. +6 −6 test/test-spawn.c
View
10 test/run-tests.c
@@ -54,16 +54,16 @@ static int maybe_run_test(int argc, char **argv) {
return 0;
}
- if (strcmp(argv[1], "spawn_helper1") == 0) {
+ if (strcmp(argv[1], "spawn_helper_exit_code") == 0) {
return 1;
}
- if (strcmp(argv[1], "spawn_helper2") == 0) {
+ if (strcmp(argv[1], "spawn_helper_stdout") == 0) {
printf("hello world\n");
return 1;
}
- if (strcmp(argv[1], "spawn_helper3") == 0) {
+ if (strcmp(argv[1], "spawn_helper_stdin") == 0) {
char buffer[256];
fgets(buffer, sizeof(buffer) - 1, stdin);
buffer[sizeof(buffer) - 1] = '\0';
@@ -71,12 +71,12 @@ static int maybe_run_test(int argc, char **argv) {
return 1;
}
- if (strcmp(argv[1], "spawn_helper4") == 0) {
+ if (strcmp(argv[1], "spawn_helper_timeout") == 0) {
/* Never surrender, never return! */
while (1) uv_sleep(10000);
}
- if (strcmp(argv[1], "spawn_helper_suicide") == 0) {
+ if (strcmp(argv[1], "spawn_helper_exit_signal") == 0) {
kill(getpid(), SIGKILL);
while (1) uv_sleep(10000);
return 0;
View
8 test/test-spawn-sync.c
@@ -31,7 +31,7 @@ static uv_spawn_sync_t spawn;
static char* args[3];
static void init_process_options(char* test) {
- /* Note spawn_helper1 defined in test/run-tests.c */
+ /* Note spawn_helper_exit_code defined in test/run-tests.c */
int r = uv_exepath(exepath, &exepath_size);
ASSERT(r == 0);
exepath[exepath_size] = '\0';
@@ -73,7 +73,7 @@ TEST_IMPL(spawn_sync_exit_code) {
int r;
uv_init();
- init_process_options("spawn_helper1");
+ init_process_options("spawn_helper_exit_code");
r = uv_spawn_sync(uv_default_loop(), &spawn);
debug(r);
@@ -90,7 +90,7 @@ TEST_IMPL(spawn_sync_exit_signal) {
int r;
uv_init();
- init_process_options("spawn_helper_suicide");
+ init_process_options("spawn_helper_exit_signal");
r = uv_spawn_sync(uv_default_loop(), &spawn);
debug(r);
@@ -222,7 +222,7 @@ TEST_IMPL(spawn_sync_timeout) {
int r;
uv_init();
- init_process_options("spawn_helper4");
+ init_process_options("spawn_helper_timeout");
r = uv_spawn_sync(uv_default_loop(), &spawn);
debug(r);
View
12 test/test-spawn.c
@@ -95,7 +95,7 @@ void write_cb(uv_write_t* req, int status) {
static void init_process_options(char* test, uv_exit_cb exit_cb) {
- /* Note spawn_helper1 defined in test/run-tests.c */
+ /* Note spawn_helper_exit_code defined in test/run-tests.c */
int r = uv_exepath(exepath, &exepath_size);
ASSERT(r == 0);
exepath[exepath_size] = '\0';
@@ -117,7 +117,7 @@ static void timer_cb(uv_timer_t* handle, int status) {
TEST_IMPL(spawn_exit_code) {
int r;
- init_process_options("spawn_helper1", exit_cb);
+ init_process_options("spawn_helper_exit_code", exit_cb);
r = uv_spawn(uv_default_loop(), &process, options);
ASSERT(r == 0);
@@ -136,7 +136,7 @@ TEST_IMPL(spawn_stdout) {
int r;
uv_pipe_t out;
- init_process_options("spawn_helper2", exit_cb);
+ init_process_options("spawn_helper_stdout", exit_cb);
uv_pipe_init(uv_default_loop(), &out);
options.stdout_stream = &out;
@@ -167,7 +167,7 @@ int r;
uv_buf_t buf;
char buffer[] = "hello-from-spawn_stdin";
- init_process_options("spawn_helper3", exit_cb);
+ init_process_options("spawn_helper_stdin", exit_cb);
uv_pipe_init(uv_default_loop(), &out);
uv_pipe_init(uv_default_loop(), &in);
@@ -199,7 +199,7 @@ int r;
TEST_IMPL(spawn_and_kill) {
int r;
- init_process_options("spawn_helper4", kill_cb);
+ init_process_options("spawn_helper_timeout", kill_cb);
r = uv_spawn(uv_default_loop(), &process, options);
ASSERT(r == 0);
@@ -227,7 +227,7 @@ TEST_IMPL(spawn_detect_pipe_name_collisions_on_windows) {
char name[64];
HANDLE pipe_handle;
- init_process_options("spawn_helper2", exit_cb);
+ init_process_options("spawn_helper_stdout", exit_cb);
uv_pipe_init(uv_default_loop(), &out);
options.stdout_stream = &out;
Please sign in to comment.
Something went wrong with that request. Please try again.