From 09cb5b534e325fa93ec2d72491dff85179797f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Sun, 10 Aug 2014 11:18:03 +0200 Subject: [PATCH] test: fix spawn_reads_child_path when using autoconf Don't hardcode the name of the executable, take it from the exepath. Fixes #1407 --- test/test-spawn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test-spawn.c b/test/test-spawn.c index 57f0862f..11f43bdf 100644 --- a/test/test-spawn.c +++ b/test/test-spawn.c @@ -1295,23 +1295,25 @@ TEST_IMPL(closed_fd_events) { TEST_IMPL(spawn_reads_child_path) { int r; int len; + char file[64]; char path[1024]; char *env[2] = {path, NULL}; /* Set up the process, but make sure that the file to run is relative and */ /* requires a lookup into PATH */ init_process_options("spawn_helper1", exit_cb); - options.file = "run-tests"; - args[0] = "run-tests"; /* Set up the PATH env variable */ for (len = strlen(exepath); exepath[len - 1] != '/' && exepath[len - 1] != '\\'; len--); + strcpy(file, exepath + len); exepath[len] = 0; strcpy(path, "PATH="); strcpy(path + 5, exepath); + options.file = file; + options.args[0] = file; options.env = env; r = uv_spawn(uv_default_loop(), &process, &options);