automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] {maint} tests: improve tests on "maintainer-clean" target


From: Ralf Wildenhues
Subject: Re: [PATCH] {maint} tests: improve tests on "maintainer-clean" target
Date: Wed, 30 Mar 2011 19:15:01 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

* Stefano Lattarini wrote on Wed, Mar 30, 2011 at 05:47:44PM CEST:
> So I've seized this opportunity to do some minor refactoring and extending in
> the tests for the "maintainer-clean" target.  The resulting simple patch (for
> maint)  is attached.  A quick "grep maintainer-clean *.test" should show that
> I haven't just duplicated existing checks.
> 
> I'll push in 72 hours if there are no objections.

A general comment: if you keep on adding tests to maint, it will break
branch-1.11 in the long run, in the sense that the branch will not be
releasable any more without splitting up the test suite, or improving
the test suite driver as discussed before, as it will not work any more
on MinGW/MSYS.  Please keep this in mind.

(Same holds for master, of course, but that train's already left so
there is no need to hold back ...)

Patch is otherwise ok, with a really minor nit below.

Thanks,
Ralf

> Subject: [PATCH] tests: improve tests on "maintainer-clean" target
> 
> * tests/aclocal6.test: Move checks related to "maintainer-clean"
> functionalities into ...
> * tests/maintclean-vpath.test: ... this new test.
> * tests/maintclean.test: Update heading comments.  Extend to also
> test subdirs.  Remove useless disabling of YACC.  Fix m4 quoting
> in configure.in.  Add a trailing `:' command.
> * tests/Makefile.am (TESTS): Update.

> --- /dev/null
> +++ b/tests/maintclean-vpath.test

> +# Make sure distclean and maintainer-clean erase the right files.
> +# This test is for VPATH builds; see sister test `maintclean-vpath.test'
> +# for in-tree builds.
> +
> +. ./defs || Exit 1
> +
> +set -e
> +
> +cat >> configure.in << 'END'
> +AC_CONFIG_FILES([bar sub/Makefile])
> +AC_OUTPUT
> +END
> +
> +cat > Makefile.am <<'END'
> +
> +SUBDIRS = sub
> +
> +noinst_DATA = foo.c
> +
> +foo.c:
> +     touch foo.c
> +
> +MAINTAINERCLEANFILES = foo.c
> +
> +END

Can we compactify vertically a bit here?

SUBDIRS = sub
noinst_DATA = foo.c
MAINTAINERCLEANFILES = foo.c

foo.c:
        touch foo.c

or some other reasonable way that doesn't just introduce an empty line
at every possible place for no other reason?  Similarly in the other
test.

> +mkdir sub
> +cat > sub/Makefile.am <<'END'
> +
> +noinst_SCRIPTS = zap
> +
> +zap: zap.sh
> +     cp $(srcdir)/zap.sh $@ && chmod a+x $@
> +
> +MAINTAINERCLEANFILES = zap
> +
> +END
> +
> +: > bar.in
> +: > sub/zap.sh
> +
> +$ACLOCAL
> +$AUTOCONF
> +$AUTOMAKE
> +
> +# Users can disable autom4te.cache.
> +if test -d autom4te.cache; then
> +  test_cache='test -d ../autom4te.cache'
> +else
> +  test_cache=:
> +fi
> +
> +mkdir build
> +
> +chmod a-w . sub
> +
> +cd build
> +
> +../configure
> +test -f bar
> +
> +$MAKE
> +test -f foo.c
> +test -f sub/zap
> +$test_cache
> +
> +$MAKE distclean
> +test ! -f bar
> +test ! -f Makefile
> +test ! -f sub/Makefile
> +test ! -f config.status
> +test -f foo.c
> +test -f sub/zap
> +test -f ../sub/zap.sh
> +$test_cache
> +
> +../configure
> +test -f bar
> +
> +$MAKE foo.c
> +test -f foo.c
> +cd sub
> +$MAKE zap
> +test -f zap
> +cd ..
> +
> +chmod u+w ..
> +
> +$MAKE maintainer-clean
> +test -f ../sub/zap.sh
> +test ! -f bar
> +test ! -f foo.c
> +test ! -f sub/zap
> +test ! -f Makefile
> +test ! -f sub/Makefile
> +test ! -f config.status
> +test ! -d ../autom4te.cache
> +
> +:
> diff --git a/tests/maintclean.test b/tests/maintclean.test
> index a66464b..6503864 100755
> --- a/tests/maintclean.test
> +++ b/tests/maintclean.test
> @@ -1,5 +1,5 @@
>  #! /bin/sh
> -# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
> +# Copyright (C) 2001, 2002, 2003, 2011 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
> @@ -15,17 +15,22 @@
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  
>  # Make sure distclean and maintainer-clean erase the right files.
> +# This test is for in-tree builds; see sister test `maintclean-vpath.test'
> +# for VPATH builds.
>  
>  . ./defs || Exit 1
>  
>  set -e
>  
>  cat >> configure.in << 'END'
> -AC_CONFIG_FILES(bar)
> +AC_CONFIG_FILES([bar sub/Makefile])
>  AC_OUTPUT
>  END
>  
>  cat > Makefile.am <<'END'
> +
> +SUBDIRS = sub
> +
>  noinst_DATA = foo.c
>  
>  foo.c:
> @@ -35,7 +40,20 @@ MAINTAINERCLEANFILES = foo.c
>  
>  END
>  
> -touch bar.in
> +mkdir sub
> +cat > sub/Makefile.am <<'END'
> +
> +noinst_SCRIPTS = zap
> +
> +zap: zap.sh
> +     cp $(srcdir)/zap.sh $@ && chmod a+x $@
> +
> +MAINTAINERCLEANFILES = zap
> +
> +END
> +
> +: > bar.in
> +: > sub/zap.sh
>  
>  $ACLOCAL
>  $AUTOCONF
> @@ -48,18 +66,22 @@ else
>    test_cache=:
>  fi
>  
> -# Since we don't require Yacc, make sure it's not used.
> -./configure YACC=false
> +./configure
>  test -f bar
>  
>  $MAKE
>  test -f foo.c
> +test -f sub/zap
> +$test_cache
>  
>  $MAKE distclean
>  test ! -f bar
>  test ! -f Makefile
> +test ! -f sub/Makefile
>  test ! -f config.status
>  test -f foo.c
> +test -f sub/zap
> +test -f sub/zap.sh
>  $test_cache
>  
>  ./configure
> @@ -67,10 +89,19 @@ test -f bar
>  
>  $MAKE foo.c
>  test -f foo.c
> +cd sub
> +$MAKE zap
> +test -f zap
> +cd ..
>  
>  $MAKE maintainer-clean
> +test -f sub/zap.sh
>  test ! -f bar
>  test ! -f foo.c
> +test ! -f sub/zap
>  test ! -f Makefile
> +test ! -f sub/Makefile
>  test ! -f config.status
>  test ! -d autom4te.cache

Thanks,
Ralf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]