tests: expose automake bug#14560
[platform/upstream/automake.git] / t / dist-formats.tap
old mode 100755 (executable)
new mode 100644 (file)
index 84f4eda..7829512
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-2013 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 # archives.
 
 am_create_testdir=empty
-. ./defs || exit 1
+. test-init.sh
 
 plan_ 70
 
@@ -28,7 +28,7 @@ plan_ 70
 
 ocwd=$(pwd) || fatal_ "getting current working directory"
 
-TAR='' && unset TAR
+unset TAR
 
 # Create common aclocal.m4 file, for later tests.
 mkdir setup \
@@ -88,9 +88,22 @@ have_compressor ()
       return 1
       ;;
     *)
+      case $1 in
+        # Do not use --version, or older versions bzip2 would try to
+        # compress stdin.  This would cause binary output in the test
+        # logs, with potential breakage of our testsuite harness.
+        bzip2) o=--help;;
+        # OpenSolaris zip do not support the '--version' option, but
+        # accepts the '-v' one with a similar meaning (if no further
+        # arguments are given).
+        zip) o=-v;;
+        # Assume the other compressors we care about support the
+        # '--version' option.
+        *) o=--version;;
+      esac
       # Redirect to stderr to avoid polluting the output, in case this
       # function is used in a command substitution (as it is, below).
-      if $1 --version </dev/null >&2; then
+      if $1 $o </dev/null >&2; then
         return 0
       else
         return 1