bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-libunistring] ‘test-xalloc-die’ failure


From: Jim Meyering
Subject: Re: [bug-libunistring] ‘test-xalloc-die’ failure
Date: Fri, 27 Nov 2009 10:21:20 +0100

Ludovic Courtès wrote:
> With the help of Rob Vermaas of NixOS (TU Delft), I’ve added a
> libunistring job to Hydra so that libunistring would be continuously
> built from Git:
>
>   http://hydra.nixos.org/jobset/gnu/libunistring/all
>
> Currently, ‘test-xalloc-die’ fails:
>
> --- - 2009-11-24 09:34:42.262810741 +0000
> +++ t-xalloc-die.tmp-stdout2  2009-11-24 09:34:42.260802579 +0000
> @@ -1 +1 @@
> -test-xalloc-die: memory exhausted
> +/tmp/nix-build-286jyqxch953q4fb7pzbzhzbv76pp6y8-libunistring-0.9.1.1.drv-0/libunistring-0.9.1.1/tests/.libs/lt-test-xalloc-die:
>  memory exhausted
> FAIL: test-xalloc-die.sh
>
> (See http://hydra.nixos.org/build/158027/log/raw .)
>
> I’ll leave the fix as an exercise to the reader.  ;-)

Hi Ludo,

Thanks for the report.

Simon, here's a proposed fix:
It passes my simple test of running like this (no libtool, though):

  ./gnulib-tool --create-testdir --with-tests --test xalloc-die

Ok to push?

>From fed81b331283a3bf7a8608a5c6282ee8594b229f Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 27 Nov 2009 10:19:32 +0100
Subject: [PATCH] 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}.
---
 ChangeLog                |   14 ++++++++++++++
 modules/xalloc-die-tests |    1 +
 tests/test-xalloc-die.c  |    6 +++---
 tests/test-xalloc-die.sh |    2 +-
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 25e8b59..27a6abc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-27  Jim Meyering  <address@hidden>
+
+       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  <address@hidden>

        w32sock: leave win32 error in place.
diff --git a/modules/xalloc-die-tests b/modules/xalloc-die-tests
index 9b430cb..d28c95f 100644
--- a/modules/xalloc-die-tests
+++ b/modules/xalloc-die-tests
@@ -3,6 +3,7 @@ tests/test-xalloc-die.c
 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
index 88461e8..4a03a0b 100644
--- a/tests/test-xalloc-die.c
+++ b/tests/test-xalloc-die.c
@@ -19,12 +19,12 @@
 #include <config.h>

 #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
index 4b0d2c2..8a30022 100755
--- a/tests/test-xalloc-die.sh
+++ b/tests/test-xalloc-die.sh
@@ -34,7 +34,7 @@ tmpfiles="$tmpout $tmperr ${tmperr}2"

 PATH=".:$PATH"
 export PATH
-test-xalloc-die${EXEEXT} 2> ${tmperr} > ${tmpout}
+test-xalloc-die 2> ${tmperr} > ${tmpout}
 case $? in
   1) ;;
   *) (exit 1); exit 1 ;;
--
1.6.6.rc0.57.gad7a




reply via email to

[Prev in Thread] Current Thread [Next in Thread]