On mingw, this error message was seen: test-nonblocking-reader.h:110: assertion failed (NULL): ./test-nonblocking-socket-child.exe subprocess got fatal signal 15 test-nonblocking-socket-main.c:117: assertion failed FAIL: test-nonblocking-socket.sh
Obviously, the variable program_name had the value NULL when it shouldn't. This fixes it. 2012-02-04 Bruno Haible <br...@clisp.org> spawn-pipe tests: Fix a NULL program name in a diagnostic. * tests/test-spawn-pipe-main.c: Include progname.h. (main): Invoke set_program_name. * modules/spawn-pipe-tests (Depends-on): Add progname. nonblocking-socket tests: Fix a NULL program name in a diagnostic. * tests/test-nonblocking-socket-main.c: Include progname.h. (main): Invoke set_program_name. * modules/nonblocking-socket-tests (Depends-on): Add progname. nonblocking-pipe tests: Fix a NULL program name in a diagnostic. * tests/test-nonblocking-pipe-main.c: Include progname.h. (main): Invoke set_program_name. * modules/nonblocking-pipe-tests (Depends-on): Add progname. --- modules/nonblocking-pipe-tests.orig Sat Feb 4 18:16:42 2012 +++ modules/nonblocking-pipe-tests Sat Feb 4 17:05:10 2012 @@ -13,6 +13,7 @@ unistd nonblocking wait-process +progname pipe-posix dup2 environ --- modules/nonblocking-socket-tests.orig Sat Feb 4 18:16:42 2012 +++ modules/nonblocking-socket-tests Sat Feb 4 17:05:10 2012 @@ -16,6 +16,7 @@ sys_socket nonblocking wait-process +progname environ posix_spawnp netinet_in --- modules/spawn-pipe-tests.orig Sat Feb 4 18:16:42 2012 +++ modules/spawn-pipe-tests Sat Feb 4 17:05:10 2012 @@ -6,6 +6,7 @@ Depends-on: close +progname configure.ac: --- tests/test-nonblocking-pipe-main.c.orig Sat Feb 4 18:16:42 2012 +++ tests/test-nonblocking-pipe-main.c Sat Feb 4 17:03:01 2012 @@ -32,6 +32,7 @@ #include "nonblocking.h" #include "wait-process.h" +#include "progname.h" #include "macros.h" #include "test-nonblocking-pipe.h" @@ -41,12 +42,17 @@ int main (int argc, char *argv[]) { - const char *child_path = argv[1]; - int test = atoi (argv[2]); + const char *child_path; + int test; int fd[2]; int child; int exitcode; + set_program_name (argv[0]); + + child_path = argv[1]; + test = atoi (argv[2]); + /* Create a pipe. */ ASSERT (pipe (fd) >= 0); --- tests/test-nonblocking-socket-main.c.orig Sat Feb 4 18:16:42 2012 +++ tests/test-nonblocking-socket-main.c Sat Feb 4 17:03:01 2012 @@ -33,6 +33,7 @@ #include "nonblocking.h" #include "wait-process.h" +#include "progname.h" #include "macros.h" #include "socket-server.h" @@ -43,14 +44,19 @@ int main (int argc, char *argv[]) { - const char *child_path = argv[1]; - int test = atoi (argv[2]); + const char *child_path; + int test; int server; int port; int child; int server_socket; int exitcode; + set_program_name (argv[0]); + + child_path = argv[1]; + test = atoi (argv[2]); + /* Create a server socket. */ server = create_server (0, 1, &port); --- tests/test-spawn-pipe-main.c.orig Sat Feb 4 18:16:42 2012 +++ tests/test-spawn-pipe-main.c Sat Feb 4 17:03:01 2012 @@ -19,6 +19,7 @@ #include "spawn-pipe.h" #include "wait-process.h" +#include "progname.h" #include <stdbool.h> #include <stdio.h> @@ -80,6 +81,8 @@ int test; int fd; + set_program_name (argv[0]); + if (argc != 3) { fprintf (stderr, "%s: need 2 arguments\n", argv[0]);