summaryrefslogtreecommitdiff
path: root/tests/test-getprogname.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2016-10-19 00:33:01 +0200
committerBruno Haible <bruno@clisp.org>2016-10-19 03:02:39 +0200
commitf4d66852016a227a506dec28cc4c500b7d045ddd (patch)
treefa5dcfa3b9479d1ed68e325f8492cd2d08d2f2c8 /tests/test-getprogname.c
parent7082adff580e7e3b2dc881a68cb28c88a157eda7 (diff)
downloadgnulib-f4d66852016a227a506dec28cc4c500b7d045ddd.tar.gz
getprogname tests: Avoid failure in packages that use libtool.
* tests/test-getprogname.c (main): Strip "lt-" prefix. Based on a patch by Jim Meyering.
Diffstat (limited to 'tests/test-getprogname.c')
-rw-r--r--tests/test-getprogname.c7
1 files changed, 7 insertions, 0 deletions
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),