]> Savannah Git Hosting - gnulib.git/commitdiff
getprogname tests: Avoid failure in packages that use libtool.
authorBruno Haible <bruno@clisp.org>
Tue, 18 Oct 2016 22:33:01 +0000 (00:33 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 19 Oct 2016 01:02:39 +0000 (03:02 +0200)
* tests/test-getprogname.c (main): Strip "lt-" prefix.
Based on a patch by Jim Meyering.

ChangeLog
tests/test-getprogname.c

index faff0427817252809489be373390811f0534858f..08ad0fdc046750eff73b683ce545e73d29245eb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-18  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        getprogname: Fix test failure on Cygwin. Comments.
index b39ab37dddef688786b36aeae7821545e05382fc..6cb664315f5a074d42315978591e5029adb3ac06 100644 (file)
@@ -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),