On mingw, when libtool is in use (such as in GNU gettext when --disable-shared is not specified), 4 gnulib tests fail: test-posix_spawn-inherit0 test-posix_spawn-inherit1 test-posix_spawn-open1 test-posix_spawn-open2
For example, test-posix_spawn-open1 fails with the error test-posix_spawn-open1:./.libs/lt-test-posix_spawn-open1.c:236: FATAL: couldn't find test-posix_spawn-open1. In other words, the parent process successfully creates a child process that executes test-posix_spawn-open1.exe (with an argv[0] = "test-posix_spawn-open1"). That executable is the libtool wrapper. It uses find_executable (argv[0]) to locate the delegate executable. Given that argv[0], it does not find .libs/test-posix_spawn-open1.exe. The fix is to make sure that argv[0] has a ".exe" suffix. Thus, this patch fixes it. (Although it is debatable whether that is a bug in the libtool wrapper's find_executable function.) 2022-09-14 Bruno Haible <br...@clisp.org> posix_spawn-* tests: Fix test failure on mingw when libtool is in use. * tests/test-posix_spawn-inherit0.c (CHILD_PROGRAM_FILENAME): Add the EXEEXT suffix. * tests/test-posix_spawn-inherit1.c (CHILD_PROGRAM_FILENAME): Likewise. * tests/test-posix_spawn-open1.c (CHILD_PROGRAM_FILENAME): Likewise. * tests/test-posix_spawn-open2.c (CHILD_PROGRAM_FILENAME): Likewise. diff --git a/tests/test-posix_spawn-inherit0.c b/tests/test-posix_spawn-inherit0.c index 4995ab7462..4e479233d9 100644 --- a/tests/test-posix_spawn-inherit0.c +++ b/tests/test-posix_spawn-inherit0.c @@ -31,7 +31,7 @@ #include <sys/types.h> #include <sys/wait.h> -#define CHILD_PROGRAM_FILENAME "test-posix_spawn-inherit0" +#define CHILD_PROGRAM_FILENAME "test-posix_spawn-inherit0" EXEEXT #define DATA_FILENAME "test-posix_spawn-inh0-data.tmp" static int diff --git a/tests/test-posix_spawn-inherit1.c b/tests/test-posix_spawn-inherit1.c index 2e72a1a5a0..3308e30375 100644 --- a/tests/test-posix_spawn-inherit1.c +++ b/tests/test-posix_spawn-inherit1.c @@ -31,7 +31,7 @@ #include <sys/types.h> #include <sys/wait.h> -#define CHILD_PROGRAM_FILENAME "test-posix_spawn-inherit1" +#define CHILD_PROGRAM_FILENAME "test-posix_spawn-inherit1" EXEEXT #define DATA_FILENAME "test-posix_spawn-inh1-data.tmp" static int diff --git a/tests/test-posix_spawn-open1.c b/tests/test-posix_spawn-open1.c index df4eb8917f..21e3cb4c05 100644 --- a/tests/test-posix_spawn-open1.c +++ b/tests/test-posix_spawn-open1.c @@ -37,7 +37,7 @@ SIGNATURE_CHECK (posix_spawn, int, (pid_t *, char const *, #include <sys/types.h> #include <sys/wait.h> -#define CHILD_PROGRAM_FILENAME "test-posix_spawn-open1" +#define CHILD_PROGRAM_FILENAME "test-posix_spawn-open1" EXEEXT #define DATA_FILENAME "t!#$%&'()*+,-;=?@[\\]^_`{|}~.tmp" /* On Windows (including Cygwin), '*' '?' '\\' '|' cannot be used in file names. */ diff --git a/tests/test-posix_spawn-open2.c b/tests/test-posix_spawn-open2.c index 127d7a0b37..49ea5ed957 100644 --- a/tests/test-posix_spawn-open2.c +++ b/tests/test-posix_spawn-open2.c @@ -31,7 +31,7 @@ #include <sys/types.h> #include <sys/wait.h> -#define CHILD_PROGRAM_FILENAME "test-posix_spawn-open2" +#define CHILD_PROGRAM_FILENAME "test-posix_spawn-open2" EXEEXT #define DATA_FILENAME "test-posix_spawn-open2-data.tmp" static int