# HG changeset patch # User Jim Meyering # Date 1259313572 -3600 # Node ID 43c3308eae10ca83105a439e823e6e640876f714 # Parent 7beaf2dc28a97cafdfcb9651200d849d2aa6d5fb test-xalloc-die: avoid spurious failure due to libtool argv difference In a libtool-enabled project, this test would fail due to a difference in the emitted program name, e.g., -test-xalloc-die: memory exhausted +/tmp/.../tests/.libs/lt-test-xalloc-die: memory exhausted Use program to avoid that. * modules/xalloc-die-tests (Depends-on): Add progname. * tests/test-xalloc-die.c: Include progname.h". (program_name): Remove decl. (main): Call set_program_name. * tests/test-xalloc-die.sh (compare): Remove unnecessary ${EXE}. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-11-27 Jim Meyering + + test-xalloc-die: avoid spurious failure due to libtool argv difference + In a libtool-enabled project, this test would fail due to a difference + in the emitted program name, e.g., + -test-xalloc-die: memory exhausted + +/tmp/.../tests/.libs/lt-test-xalloc-die: memory exhausted + Use program to avoid that. + * modules/xalloc-die-tests (Depends-on): Add progname. + * tests/test-xalloc-die.c: Include progname.h". + (program_name): Remove decl. + (main): Call set_program_name. + * tests/test-xalloc-die.sh (compare): Remove unnecessary ${EXE}. + 2009-11-26 Richard Jones w32sock: leave win32 error in place. diff --git a/modules/xalloc-die-tests b/modules/xalloc-die-tests --- a/modules/xalloc-die-tests +++ b/modules/xalloc-die-tests @@ -3,6 +3,7 @@ tests/test-xalloc-die.sh Depends-on: +progname Makefile.am: TESTS += test-xalloc-die.sh diff --git a/tests/test-xalloc-die.c b/tests/test-xalloc-die.c --- a/tests/test-xalloc-die.c +++ b/tests/test-xalloc-die.c @@ -19,12 +19,12 @@ #include #include "xalloc.h" - -char *program_name = "test-xalloc-die"; +#include "progname.h" int -main (void) +main (int argc, char **argv) { + set_program_name (argv[0]); xalloc_die (); return 0; } diff --git a/tests/test-xalloc-die.sh b/tests/test-xalloc-die.sh --- a/tests/test-xalloc-die.sh +++ b/tests/test-xalloc-die.sh @@ -34,7 +34,7 @@ PATH=".:$PATH" export PATH -test-xalloc-die${EXEEXT} 2> ${tmperr} > ${tmpout} +test-xalloc-die 2> ${tmperr} > ${tmpout} case $? in 1) ;; *) (exit 1); exit 1 ;;