]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/am/progs.am (installcheck-%DIR%PROGRAMS): Honor
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 22 Jul 2002 17:00:44 +0000 (17:00 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 22 Jul 2002 17:00:44 +0000 (17:00 +0000)
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT.
* lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Likewise.
* automake.texi (Options) <std-options>: Document
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT.
(Gnits): Reference std-options.
* tests/gnits3.test: New file.
* tests/Makefile.am (TESTS): Add gnits3.test.
Suggested by Jim Meyering.

ChangeLog
automake.texi
lib/am/progs.am
lib/am/scripts.am
stamp-vti
tests/Makefile.am
tests/Makefile.in
tests/gnits3.test [new file with mode: 0755]
version.texi

index 83cbbe86d515fa4f681e1be305ad8fd60bb6b322..f4eca454b85ad0f825f668ca712d5142a3b5bf0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2002-07-21  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * lib/am/progs.am (installcheck-%DIR%PROGRAMS): Honor
+       AM_INSTALLCHECK_STD_OPTIONS_EXEMPT.
+       * lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Likewise.
+       * automake.texi (Options) <std-options>: Document
+       AM_INSTALLCHECK_STD_OPTIONS_EXEMPT.
+       (Gnits): Reference std-options.
+       * tests/gnits3.test: New file.
+       * tests/Makefile.am (TESTS): Add gnits3.test.
+       Suggested by Jim Meyering.
+
 2002-07-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        * tests/gnits2.test: Use --program-prefix.  Test for scripts too.
index 97271ee5005555d0f14d0fbb92e9890dbb4081b3..3522308f2f5c55fb5e1175ddc72f4aaee052b4ca 100644 (file)
@@ -4274,8 +4274,17 @@ letter; it should be omitted for non-alpha releases.
 
 @item @code{std-options}
 @cindex Options, std-options
+@cindex make installcheck
 Make the @code{installcheck} target check that installed scripts and
 programs support the @code{--help} and @code{--version} options.
+This also provides a basic check that the program's
+run-time dependencies are satisfied after installation.
+
+@vindex AM_INSTALLCHECK_STD_OPTIONS_EXEMPT
+In a few situations, programs (or scripts) have to be exempted from this
+test.  For instance @command{false} (from GNU sh-utils) is never
+successful, even for @code{--help} or @code{--version}.  You can
+list such programs in the variable @code{AM_INSTALLCHECK_STD_OPTIONS_EXEMPT}.
 
 @item @code{subdir-objects}
 If this option is specified, then objects are placed into the
@@ -4600,8 +4609,7 @@ checks the following as well:
 @item
 @samp{make installcheck} will check to make sure that the @code{--help}
 and @code{--version} really print a usage message and a version string,
-respectively.  This also provides a basic check that the program's
-run-time dependencies are satisfied after installation.
+respectively.  This is the @code{std-options} option (@pxref{Options}).
 
 @item
 @samp{make dist} will check to make sure the @file{NEWS} file has been
index 3c1c0e8cdb439af00f189a78cce1ed1136f72bb2..9afe0dea46593bf02da9543b1618633db38c49de 100644 (file)
@@ -109,6 +109,9 @@ if %?CK-OPTS%
 .PHONY installcheck-am: installcheck-%DIR%PROGRAMS
 installcheck-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
        bad=0; pid=$$$$; list="$(%DIR%_PROGRAMS)"; for p in $$list; do \
+         case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+          *" $$p "*) continue;; \
+         esac; \
 ## Strip the directory and $(EXEEXT) before applying $(transform).
          f=`echo "$$p" | \
             sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
index 9f244869365138bbf5cd3f34cab7a0be16b51446..6b219d691be7b15710d1dbb6d5bd4a824afd42d0 100644 (file)
@@ -88,6 +88,9 @@ if %?CK-OPTS%
 .PHONY installcheck-am: installcheck-%DIR%SCRIPTS
 installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
        bad=0; pid=$$$$; list="$(%DIR%_SCRIPTS)"; for p in $$list; do \
+         case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+          *" $$p "*) continue;; \
+         esac; \
 ## Strip any leading directory before applying $(transform).
          f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \
 ## Insert the directory back if nobase_ is used.
index e5cda01dba6683d4a64763f9b7db5e34a0add985..b35254a6e8900f71c5c4857e2ee2d09576bbb00c 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 16 July 2002
+@set UPDATED 21 July 2002
 @set UPDATED-MONTH July 2002
 @set EDITION 1.6a
 @set VERSION 1.6a
index dbed2d197159c42183394d657b2a85dd630ae8a0..23bfee93d764c5c84be71f96ea4f3d8a8029270c 100644 (file)
@@ -178,6 +178,7 @@ gettext2.test \
 gnuwarn.test \
 gnits.test \
 gnits2.test \
+gnits3.test \
 header.test \
 implicit.test \
 include.test \
index 1447a9311d42e2f754639468af66145d6ff3ae67..27e0d978ad4335894eeb913e0b67454eff5f0eb6 100644 (file)
@@ -266,6 +266,7 @@ gettext2.test \
 gnuwarn.test \
 gnits.test \
 gnits2.test \
+gnits3.test \
 header.test \
 implicit.test \
 include.test \
diff --git a/tests/gnits3.test b/tests/gnits3.test
new file mode 100755 (executable)
index 0000000..256023b
--- /dev/null
@@ -0,0 +1,80 @@
+#! /bin/sh
+
+# Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
+
+required=gcc
+. $srcdir/defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+# We use the same basename for all targets on purpose.  This way
+# we make sure that `AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok'
+# will not match anything containing `nok'.
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = gnits
+
+nobase_bin_PROGRAMS = nok sub/nok
+nok_SOURCES = nok.c
+sub_nok_SOURCES = nok.c
+
+nobase_bin_SCRIPTS = nok.sh sub/nok.sh
+
+AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok nok.sh
+END
+
+echo 'int main () { return 0; }' > nok.c
+
+mkdir sub
+
+cat >nok.sh <<EOF
+#!/bin/sh
+echo "Which version? Which usage?"
+exit 1
+EOF
+
+cp nok.sh sub/nok.sh
+
+chmod +x nok.sh
+chmod +x sub/nok.sh
+
+# Files required by Gnits.
+: > INSTALL
+: > NEWS
+: > README
+: > COPYING
+: > AUTHORS
+: > ChangeLog
+: > THANKS
+
+set -e
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkdir build
+cd build
+
+# Use --program-prefix to make sure the std-options check honors it.
+../configure --prefix=`pwd`/../inst-dir --program-prefix=p
+$MAKE
+$MAKE install
+$MAKE -k installcheck 2>stderr && exit 1
+cat stderr
+grep 'sub/pnok does not support' stderr
+grep 'sub/pnok.sh does not support' stderr
+# Only two failures please.
+test `grep 'does not support --help' stderr | wc -l` = 2
+test `grep 'does not support --version' stderr | wc -l` = 2
+
+
+# Make sure there is no more error when all targets are exempted.
+cd ..
+echo 'AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += sub/nok sub/nok.sh' >> Makefile.am
+$AUTOMAKE
+cd build
+./config.status  # Don't rely on the rebuild rules (they need GNU make).
+$MAKE installcheck
index e5cda01dba6683d4a64763f9b7db5e34a0add985..b35254a6e8900f71c5c4857e2ee2d09576bbb00c 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 16 July 2002
+@set UPDATED 21 July 2002
 @set UPDATED-MONTH July 2002
 @set EDITION 1.6a
 @set VERSION 1.6a