[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Modernize, improve and/or tweak various test scripts.
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH] Modernize, improve and/or tweak various test scripts. |
Date: |
Sun, 7 Nov 2010 10:21:31 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hi Stefano,
* Stefano Lattarini wrote on Mon, Sep 13, 2010 at 11:22:37AM CEST:
> I updated the patch slighty (see test `depdist.test') to follow the
> emerging principle of preferring "semantic" tests to "grepping" tests
> in the Automake testsuite.
OK with nits addressed.
and in another mail:
> Pinging this patch again, following this:
> <http://lists.gnu.org/archive/html/automake-patches/2010-11/msg00003.html>
>
> There should be no need to rebase the patch (which is based off of maint),
> so that I should just be able to merge it into master from the copy in my
> local automake repository (maybe fixing the date of the ChangeLog entry
> after the merge?)
Yes, sure.
Thanks,
Ralf
> From b6d67d34e440ef275f77c955a84658fb70c160f0 Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini <address@hidden>
> Date: Mon, 21 Jun 2010 18:07:09 +0200
> Subject: [PATCH] Modernize, improve and/or tweak various test scripts.
>
> * tests/stamph2.test: Improve m4 quoting in `configure.in', and
> prefer trailing `:' over trailing `Exit 0'.
> * tests/syntax.test: Escape literal dots in grep regexps.
> * tests/copy.test: Enable `errexit' shell flag. Extend test by
> checking with `test' utility that the script `install-sh' is
> copied, but not symlinked.
> * tests/depdist.test: Move setting of `errexit' shell flag earlier
> in the script (just after inclusion of ./defs). Avoid obsoleted
> constructs in generated `configure.in'. Prefer to do our checks
> by running configure and make over grepping Makefile.in.
> * tests/target-cflags: Move setting of `errexit' shell flag
> earlier in the script (just after inclusion of ./defs). Use the
> `configure.in' stub created by `./defs', rather than writing it
> from scratch.
> * tests/target-clash: Do not uselessly run autoconf.
> * tests/ctarget1.test: Renamed ...
Please don't rename tests unless for a very good reason, and
please don't reuse names from tests that have been removed.
In case there is ever a merge across such a rename, git may
get confused without reason, and if there are automatic regression
testers they might think that there is a regression where there is
none, or vice versa.
> * tests/cond1.test: ... to this. Use the `configure.in' stub
> created by `./defs', rather than writing it from scratch.
> Move setting of `errexit' shell flag earlier in the script (just
> after inclusion of ./defs). Other minor cosmetic changes.
> * tests/Makefile.am (TESTS): Updated.
> --- a/tests/depdist.test
> +++ b/tests/depdist.test
> @@ -17,40 +17,60 @@
> # Make sure depcomp is found for the distribution.
> # From Eric Magnien.
>
> +required=gcc # FIXME: any C compiler should be ok!
Why this? There is nothing in the test that requires GCC.
You can drop this line AFAICS.
> . ./defs || Exit 1
>
> +set -e
> +
> rm -f configure.in
>
> mkdir config
> for i in *; do
> - if test $i != "config"; then
> - mv $i config
> + if test "$i" != "config"; then
> + mv -f "$i" config
> fi
> done
>
> -cat > configure.in << 'END'
> -AC_INIT(subdir/foo.c)
> -AC_CONFIG_AUX_DIR(config)
> -AM_INIT_AUTOMAKE(nonesuch, nonesuch)
> +cat > configure.in << END
> +AC_INIT([$me], [1.0])
> +AC_CONFIG_AUX_DIR([config])
> +AM_INIT_AUTOMAKE
> AC_PROG_CC
> -AC_OUTPUT(subdir/Makefile Makefile)
> +AC_CONFIG_FILES([subdir/Makefile Makefile])
> +AC_OUTPUT
> END
>
> cat > Makefile.am << 'END'
> SUBDIRS = subdir
> +check-local: test1 test2
> +.PHONY: test1 test2
> +test1:
> + echo ' ' $(DIST_COMMON) ' ' | grep '[ /]config/depcomp '
> +test2: distdir
> + ls -l $(distdir)/*
> + test -f $(distdir)/config/depcomp
> END
>
> mkdir subdir
> -: > subdir/foo.c
> +cat > subdir/foo.c << 'END'
> +int main(void)
> +{
> + return 0;
> +}
> +END
>
> cat > subdir/Makefile.am << 'END'
> bin_PROGRAMS = foo
> foo_SOURCES = foo.c
> END
>
> -set -e
> -
> $ACLOCAL
> -$AUTOMAKE --add-missing
> $AUTOCONF
> -grep config/depcomp Makefile.in
> +$AUTOMAKE --add-missing
> +
> +./configure
> +
> +$MAKE check
> +$MAKE distcheck
> +
> +:
[...]
- Re: [PATCH] Modernize, improve and/or tweak various test scripts.,
Ralf Wildenhues <=