Attached is what I pushed (to *master* only). Regards, Stefano
From 7e7a8a6497cbc2473a3e25dd1067f2d44346325e Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Tue, 21 Dec 2010 22:59:19 +0100 Subject: [PATCH] Add some tests on 'cygnus' mode.
* tests/clean2.test: Extend. * tests/cygnus-check-without-all.test: New test. * tests/cygnus-dependency-tracking.test: Likewise. * tests/cygnus-distclean.test: Likewise. * tests/cygnus-imply-foreign.test: Likewise. * tests/cygnus-no-dist.test: Likewise. * tests/cygnus-no-installinfo.test: Likewise. * tests/cygnus-requires-maintainer-mode.test: Likewise. * tests/Makefile.am (TESTS): Update. --- ChangeLog | 13 ++++ tests/Makefile.am | 6 ++ tests/Makefile.in | 6 ++ tests/clean2.test | 21 ++++++- tests/cygnus-check-without-all.test | 52 +++++++++++++++++ tests/cygnus-dependency-tracking.test | 73 +++++++++++++++++++++++ tests/cygnus-imply-foreign.test | 61 ++++++++++++++++++++ tests/cygnus-no-dist.test | 86 ++++++++++++++++++++++++++++ tests/cygnus-no-installinfo.test | 55 ++++++++++++++++++ tests/cygnus-requires-maintainer-mode.test | 53 +++++++++++++++++ 10 files changed, 424 insertions(+), 2 deletions(-) create mode 100755 tests/cygnus-check-without-all.test create mode 100755 tests/cygnus-dependency-tracking.test create mode 100755 tests/cygnus-imply-foreign.test create mode 100755 tests/cygnus-no-dist.test create mode 100755 tests/cygnus-no-installinfo.test create mode 100755 tests/cygnus-requires-maintainer-mode.test diff --git a/ChangeLog b/ChangeLog index 2c057a1..0540fc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2010-12-22 Stefano Lattarini <stefano.lattar...@gmail.com> + Add some tests on 'cygnus' mode. + * tests/clean2.test: Extend. + * tests/cygnus-check-without-all.test: New test. + * tests/cygnus-dependency-tracking.test: Likewise. + * tests/cygnus-distclean.test: Likewise. + * tests/cygnus-imply-foreign.test: Likewise. + * tests/cygnus-no-dist.test: Likewise. + * tests/cygnus-no-installinfo.test: Likewise. + * tests/cygnus-requires-maintainer-mode.test: Likewise. + * tests/Makefile.am (TESTS): Update. + +2010-12-22 Stefano Lattarini <stefano.lattar...@gmail.com> + Fix parallel testsuite run with Zsh. This change deals with a Zsh incompatibility in the handling of the special shell variable `$0' in sourced files; this diff --git a/tests/Makefile.am b/tests/Makefile.am index 90b58fe..05e15bc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -326,6 +326,12 @@ cxxlibobj.test \ cxxlink.test \ cxxnoc.test \ cxxo.test \ +cygnus-check-without-all.test \ +cygnus-dependency-tracking.test \ +cygnus-imply-foreign.test \ +cygnus-no-dist.test \ +cygnus-no-installinfo.test \ +cygnus-requires-maintainer-mode.test \ cygwin32.test \ dash.test \ defun.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 45a6401..d0e08a6 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -589,6 +589,12 @@ cxxlibobj.test \ cxxlink.test \ cxxnoc.test \ cxxo.test \ +cygnus-check-without-all.test \ +cygnus-dependency-tracking.test \ +cygnus-imply-foreign.test \ +cygnus-no-dist.test \ +cygnus-no-installinfo.test \ +cygnus-requires-maintainer-mode.test \ cygwin32.test \ dash.test \ defun.test \ diff --git a/tests/clean2.test b/tests/clean2.test index 99e4c2e..48165ce 100755 --- a/tests/clean2.test +++ b/tests/clean2.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2010 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 @@ -29,6 +29,13 @@ END cat > Makefile.am << 'END' SUBDIRS = sub + +data_DATA = bar + +bar: + touch $@ + +DISTCLEANFILES = bar END mkdir sub @@ -48,6 +55,16 @@ $AUTOMAKE --cygnus ./configure $MAKE +ls -l +test -f bar test -f sub/foo $MAKE distclean -test ! -f sub/foo +ls -l +test ! -r bar +test ! -r sub/foo +test ! -r Makefile +test ! -r config.status +test -f Makefile.in +test -f configure + +: diff --git a/tests/cygnus-check-without-all.test b/tests/cygnus-check-without-all.test new file mode 100755 index 0000000..964dc59 --- /dev/null +++ b/tests/cygnus-check-without-all.test @@ -0,0 +1,52 @@ +#! /bin/sh +# Copyright (C) 2010 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that, in cygnus mode, target "check" does not depend target +# "all". + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AM_MAINTAINER_MODE +AC_OUTPUT +END + +cat > Makefile.am <<'END' +all-local: + : > all-target-has-failed + exit 1 +check-local: + touch check-target-has-run +END + +$ACLOCAL +$AUTOMAKE --cygnus + +$EGREP '(^| )all.*(:|:.* )check' Makefile.in && Exit 1 + +$AUTOCONF +./configure + +$MAKE check +test -f check-target-has-run +test ! -r all-target-has-failed +# sanity checks +$MAKE && Exit 1 +test -f all-target-has-failed + +: diff --git a/tests/cygnus-dependency-tracking.test b/tests/cygnus-dependency-tracking.test new file mode 100755 index 0000000..f2f4aea --- /dev/null +++ b/tests/cygnus-dependency-tracking.test @@ -0,0 +1,73 @@ +#! /bin/sh +# Copyright (C) 2010 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that cygnus mode disables automatic dependency tracking. +# And check that this *cannot* be overridden. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AM_MAINTAINER_MODE +AC_PROG_CC +AC_OUTPUT +END + +cat > Makefile.am <<'END' +bin_PROGRAMS = foo +foo_SOURCES = foo.c +.PHONY: test-nodeps +test-nodeps: + test ! -d .deps + test ! -d _deps + test ! -d '$(DEPDIR)' +END + +cat > foo.c <<'END' +#include "bar.h" +int main () +{ + GIVE_BACK 0; +} +END + +cat > bar.sav <<'END' +#define GIVE_BACK return +END + +cp bar.sav bar.h + +$ACLOCAL +$AUTOMAKE --include-deps --cygnus --include-deps +$AUTOCONF + +# Unknown options should cause just warnings from configure. +./configure --enable-dependency-tracking +$MAKE +$MAKE test-nodeps + +: > bar.h +$MAKE +$MAKE test-nodeps + +# Sanity check. +$MAKE clean +$MAKE >out 2>&1 && { cat out; Exit 1; } +cat out +$FGREP 'GIVE_BACK' out + +: diff --git a/tests/cygnus-imply-foreign.test b/tests/cygnus-imply-foreign.test new file mode 100755 index 0000000..0e9a299 --- /dev/null +++ b/tests/cygnus-imply-foreign.test @@ -0,0 +1,61 @@ +#! /bin/sh +# Copyright (C) 2010 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that 'cygnus' mode imply 'foreign' mode. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +# This is *required* in cygnus mode +AM_MAINTAINER_MODE +END + +$ACLOCAL + +: > Makefile.am + +# We want complete control automake flags, while honouring the +# user overrides for $AUTOMAKE. +AUTOMAKE=$original_AUTOMAKE + +# Sanity check: gnu mode must complain about missing files and +# portability problems. +AUTOMAKE_fails +grep 'required file.*README' stderr + +# But cygnus mode should imply foreign mode, so no complaints. +# And cygnus mode should by able to override gnu and gnits modes. +$AUTOMAKE --cygnus -Werror +$AUTOMAKE --gnu --cygnus -Werror +$AUTOMAKE --gnits --cygnus -Werror + +# Try again, this time enabling cygnus mode from Makefile.am. +cp Makefile.am Makefile.sav +echo 'AUTOMAKE_OPTIONS = gnu cygnus' >> Makefile.am +$AUTOMAKE -Werror +mv -f Makefile.sav Makefile.am + +# Try again, this time enabling cygnus mode from configure.in. +cp configure.in configure.sav +sed 's/^AM_INIT_AUTOMAKE$/&([gnits cygnus])/' configure.sav >configure.in +cmp configure.in configure.sav && Exit 99 # sanity check +$ACLOCAL --force +$AUTOMAKE -Werror +mv -f configure.sav configure.in + +: diff --git a/tests/cygnus-no-dist.test b/tests/cygnus-no-dist.test new file mode 100755 index 0000000..dac7fd0 --- /dev/null +++ b/tests/cygnus-no-dist.test @@ -0,0 +1,86 @@ +#! /bin/sh +# Copyright (C) 2010 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that cygnus mode forbids creation of distribution tarball. + +. ./defs || Exit 1 + +set -e + +echo AM_MAINTAINER_MODE >> configure.in +mv -f configure.in configure.stub + +cat configure.stub - > configure.in <<'END' +AC_OUTPUT +END + +: > Makefile.am + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --cygnus + +./configure +$MAKE + +for target in dist distdir distcheck dist-all dist-gzip; do + $MAKE -n $target >out 2>&1 && { cat out; Exit 1; } + cat out + grep $target out +done + +# Now check that cygnus mode in a subdirectory disables +# distribution-building in that subdirectory. + +cat > Makefile.am <<'END' +SUBDIRS = sub1 sub2 +END + +mkdir sub1 sub2 +: > sub1/Makefile.am +cat > sub2/Makefile.am <<'END' +# The `-Wall' after `cygnus' should ensure no warning gets +# unintentionally disabled. We are particularily interested +# in override warnings, for when (below) we add the `distdir' +# target. +AUTOMAKE_OPTIONS = cygnus -Wall +END + +cat configure.stub - > configure.in <<'END' +AC_CONFIG_FILES([sub1/Makefile sub2/Makefile]) +AC_OUTPUT +END + +$AUTOCONF +$AUTOMAKE + +./configure +$MAKE +cd sub2 +$MAKE -n distdir >out 2>&1 && { cat out; Exit 1; } +grep distdir out +cd .. + +cat >> sub2/Makefile.am <<'END' +distdir: +END +$AUTOMAKE sub2/Makefile +./config.status sub2/Makefile + +$MAKE distdir +$MAKE dist + +: diff --git a/tests/cygnus-no-installinfo.test b/tests/cygnus-no-installinfo.test new file mode 100755 index 0000000..380250c --- /dev/null +++ b/tests/cygnus-no-installinfo.test @@ -0,0 +1,55 @@ +#! /bin/sh +# Copyright (C) 2010 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that cygnus mode enables the 'no-installinfo' option. + +required=makeinfo +. ./defs || Exit 1 + +set -e + +cat >> configure.in <<'END' +AM_MAINTAINER_MODE +AC_OUTPUT +END + +cat > Makefile.am <<'END' +info_TEXINFOS = foo.texi +END + +cat > foo.texi <<'END' +...@setfilename foo.info +END + +$ACLOCAL +# FIXME: -Wno-override works around a buglet in definition of $(MAKEINFO) +# in cygnus mode; see also xfailing test `txinfo5.test'. +$AUTOMAKE --cygnus -Wno-override +$AUTOCONF + +cwd=`pwd` || Exit 1 +./configure --prefix="$cwd"/_inst +$MAKE +$MAKE install +test ! -d _inst +test ! -r foo.info +test ! -d _inst/share/info +$MAKE install-info +ls -l _inst +test -f foo.info +test -f _inst/share/info/foo.info + +: diff --git a/tests/cygnus-requires-maintainer-mode.test b/tests/cygnus-requires-maintainer-mode.test new file mode 100755 index 0000000..4f893f2 --- /dev/null +++ b/tests/cygnus-requires-maintainer-mode.test @@ -0,0 +1,53 @@ +#! /bin/sh +# Copyright (C) 2010 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that, in cygnus mode, maintainer mode is required. + +. ./defs || Exit 1 + +set -e + +: > Makefile.am + +$ACLOCAL +AUTOMAKE_fails --cygnus +grep '^configure\.in:.*AM_MAINTAINER_MODE.*required.*cygnus' stderr + +cat >> configure.in <<'END' +AC_CONFIG_FILES([sub/Makefile]) +END + +cat > Makefile.am <<'END' +SUBDIRS = sub +END + +mkdir sub +cat > sub/Makefile.am <<'END' +AUTOMAKE_OPTIONS = cygnus +END + +$ACLOCAL +AUTOMAKE_fails +grep '^configure\.in:.*AM_MAINTAINER_MODE.*required.*cygnus' stderr + +cat >> configure.in <<'END' +AM_MAINTAINER_MODE +END + +$ACLOCAL +$AUTOMAKE --cygnus + +: -- 1.7.1