+2010-11-25 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ Modernize, improve and/or tweak some test scripts.
+ * tests/maintclean.test: Use proper m4 quoting. Add trailing `:'
+ command.
+ * tests/sinclude.test: Likewise, and add a couple of blank lines,
+ for clarity.
+ * tests/make.test: 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. Some
+ cosmetic changes in spacing. Ensure we wait enough time before
+ touching configure.in to trigger the rebuild rules.
+ * tests/makej.test: Use `$me' instead of hard-coding the test
+ name. Add trailing `:' command.
+ * tests/version7.test: Likewise.
+ * tests/space.test: Enable `errexit' shell flag, and related
+ changes.
+ * tests/makevars.test: Likewise. Also, prefer trailing `:' over
+ trailing `Exit 0', and be more tolerant of white spaces when
+ grepping Makefile.in.
+
2010-11-21 Stefano Lattarini <stefano.lattarini@gmail.com>
Tests: consistently use "|| Exit 1" after ". ./defs".
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 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
set -e
cat >> configure.in << 'END'
-AC_CONFIG_FILES(bar)
+AC_CONFIG_FILES([bar])
AC_OUTPUT
END
test ! -f Makefile
test ! -f config.status
test ! -d autom4te.cache
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 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
required=GNUmake
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(foo,0,no)
+set -e
+
+cat >> configure.in << 'END'
AM_MAKE_INCLUDE
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
: > Makefile.am
-set -e
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE
save="$MAKE"
for flag in '' -w; do
MAKE="$save $flag" ./configure
-
$FGREP 'am__include = include' Makefile
-
+ $sleep
touch configure.in
$MAKE $flag
-
$FGREP 'am__include = include' Makefile
-
rm -f config.cache
done
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
set -e
-cat >configure.in <<'END'
+cat >configure.in <<END
m4_include([version.m4])
-AC_INIT([version7], [THE_VERSION])
+AC_INIT([$me], [THE_VERSION])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile])
echo 'm4_define([THE_VERSION], [3.141])' > version.m4
$MAKE -j
./configure --version | grep '3\.141'
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 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
. ./defs || Exit 1
+set -e
+
# Find the macros wanted by Automake.
-$ACLOCAL || Exit 1
+$ACLOCAL
# Create some dummy Makefile.in.
: > Makefile.am
-$AUTOMAKE || Exit 1
+$AUTOMAKE
# We are definitely not needing a compiler or preprocessor.
-$EGREP '^(CC|CPP|CXX|CXXCPP) =' Makefile.in && Exit 1
+$EGREP '^ *(CC|CPP|CXX|CXXCPP) *=' Makefile.in && Exit 1
-Exit 0
+:
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003, 2005, 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
EOF
mkdir sub
+
cat > sub/p.m4 << 'END'
-AC_SUBST(MAGICALPIG)
+AC_SUBST([MAGICALPIG])
END
cat > sub/h.m4 << 'END'
-AC_SUBST(MAGICALHOG)
+AC_SUBST([MAGICALHOG])
END
cat > sub/g.m4 << 'END'
-AC_SUBST(GREPME)
+AC_SUBST([GREPME])
END
: > Makefile.am
-echo 'sinclude(sub/g.m4)' >> acinclude.m4
-echo 'm4_sinclude(sub/doesntexist.m4)' >> acinclude.m4
+echo 'sinclude([sub/g.m4])' >> acinclude.m4
+echo 'm4_sinclude([sub/doesntexist.m4])' >> acinclude.m4
$ACLOCAL
-echo 'm4_sinclude(sub/p.m4)' >> aclocal.m4
-echo 'm4_include(sub/h.m4)' >> aclocal.m4
+echo 'm4_sinclude([sub/p.m4])' >> aclocal.m4
+echo 'm4_include([sub/h.m4])' >> aclocal.m4
$AUTOMAKE
grep MAGICALPIG Makefile.in
grep MAGICALHOG Makefile.in
grep GREPME Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 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
. ./defs || Exit 1
+set -e
+
echo AC_PROG_CC >> configure.in
cat > Makefile.am << 'END'
foo_SOURCES = foo.c
END
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
#! /bin/sh
-# Copyright (C) 2002, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2008, 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
set -e
-cat >configure.in <<'END'
+cat >configure.in <<END
m4_include([version.m4])
-AC_INIT([version7], [THE_VERSION])
+AC_INIT([$me], [THE_VERSION])
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
$MAKE
grep '2\.718' version.texi
-
$sleep
echo 'm4_define([THE_VERSION], [3.141])' > version.m4
$MAKE distcheck
./configure --version | grep '3\.141'
grep '3\.141' version.texi
+
+: