From: Bruno Haible Date: Tue, 18 Oct 2016 22:33:01 +0000 (+0200) Subject: getprogname tests: Avoid failure in packages that use libtool. X-Git-Tag: v1.0~6596 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f4d66852016a227a506dec28cc4c500b7d045ddd;p=gnulib.git getprogname tests: Avoid failure in packages that use libtool. * tests/test-getprogname.c (main): Strip "lt-" prefix. Based on a patch by Jim Meyering. --- diff --git a/ChangeLog b/ChangeLog index faff042781..08ad0fdc04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-10-18 Bruno Haible + + getprogname tests: Avoid failure in packages that use libtool. + * tests/test-getprogname.c (main): Strip "lt-" prefix. + Based on a patch by Jim Meyering. + 2016-10-16 Bruno Haible getprogname: Fix test failure on Cygwin. Comments. diff --git a/tests/test-getprogname.c b/tests/test-getprogname.c index b39ab37ddd..6cb664315f 100644 --- a/tests/test-getprogname.c +++ b/tests/test-getprogname.c @@ -27,6 +27,13 @@ main (void) { char const *p = getprogname (); + /* libtool creates a temporary executable whose name is sometimes prefixed + with "lt-" (depends on the platform). But the name of the temporary + executable is a detail that should not be visible to the end user and to + the test suite. Remove this "lt-" prefix here. */ + if (strncmp (p, "lt-", 3) == 0) + p += 3; + /* Note: You can make this test fail a) by running it on a case-insensitive file system (such as on Windows, Cygwin, or on Mac OS X with a case-insensitive HFS+ file system),