From f4d66852016a227a506dec28cc4c500b7d045ddd Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 19 Oct 2016 00:33:01 +0200 Subject: [PATCH] getprogname tests: Avoid failure in packages that use libtool. * tests/test-getprogname.c (main): Strip "lt-" prefix. Based on a patch by Jim Meyering. --- ChangeLog | 6 ++++++ tests/test-getprogname.c | 7 +++++++ 2 files changed, 13 insertions(+) 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), -- 2.39.5