mirror of
https://github.com/libuv/libuv
synced 2025-03-28 21:13:16 +00:00
test: stdin/out/err should be set to /dev/null when ignored
This commit is contained in:
parent
bdb8b3a1f2
commit
1cd9642cbb
@ -120,5 +120,17 @@ static int maybe_run_test(int argc, char **argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "spawn_helper6") == 0) {
|
||||
int r;
|
||||
|
||||
r = fprintf(stdout, "hello world\n");
|
||||
ASSERT(r > 0);
|
||||
|
||||
r = fprintf(stderr, "hello errworld\n");
|
||||
ASSERT(r > 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return run_test(argv[1], TEST_TIMEOUT, 0);
|
||||
}
|
||||
|
@ -120,6 +120,7 @@ TEST_DECLARE (spawn_exit_code)
|
||||
TEST_DECLARE (spawn_stdout)
|
||||
TEST_DECLARE (spawn_stdin)
|
||||
TEST_DECLARE (spawn_stdio_greater_than_3)
|
||||
TEST_DECLARE (spawn_ignored_stdio)
|
||||
TEST_DECLARE (spawn_and_kill)
|
||||
TEST_DECLARE (spawn_detached)
|
||||
TEST_DECLARE (spawn_and_kill_with_std)
|
||||
@ -337,6 +338,7 @@ TASK_LIST_START
|
||||
TEST_ENTRY (spawn_stdout)
|
||||
TEST_ENTRY (spawn_stdin)
|
||||
TEST_ENTRY (spawn_stdio_greater_than_3)
|
||||
TEST_ENTRY (spawn_ignored_stdio)
|
||||
TEST_ENTRY (spawn_and_kill)
|
||||
TEST_ENTRY (spawn_detached)
|
||||
TEST_ENTRY (spawn_and_kill_with_std)
|
||||
|
@ -329,6 +329,27 @@ TEST_IMPL(spawn_stdio_greater_than_3) {
|
||||
}
|
||||
|
||||
|
||||
TEST_IMPL(spawn_ignored_stdio) {
|
||||
int r;
|
||||
|
||||
init_process_options("spawn_helper6", exit_cb);
|
||||
|
||||
options.stdio = NULL;
|
||||
options.stdio_count = 0;
|
||||
|
||||
r = uv_spawn(uv_default_loop(), &process, options);
|
||||
ASSERT(r == 0);
|
||||
|
||||
r = uv_run(uv_default_loop());
|
||||
ASSERT(r == 0);
|
||||
|
||||
ASSERT(exit_cb_called == 1);
|
||||
ASSERT(close_cb_called == 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
TEST_IMPL(spawn_and_kill) {
|
||||
int r;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user