2010-06-12 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Modernize, improve and/or fix tests `pluseq*.test.
+ * tests/pluseq5.test: Append to configure.in using cat with an
+ here-doc, not using echo.
+ * tests/pluseq10.test: Make sure that the captured output of
+ `make' command is always displayed. Where possible, use $FGREP
+ instead of grep (this change makes some checks slighty stricter).
+ * tests/pluseq8.test: Enable `errexit' shell flag, with related
+ changes.
+ * tests/pluseq.test: Likewise. Also, do not create useless dummy
+ data files, and use better m4 quoting in generated configure.in.
+ * tests/pluseq2.test: Likewise. Also, append to configure.in
+ using cat with an here-doc, not using echo.
+ * tests/pluseq3.test: Likewise.
+ * tests/pluseq4.test: Likewise.
+ * tests/pluseq6.test: Likewise.
+ * tests/pluseq7.test: Do not create useless dummy source file.
+ * tests/pluseq9.test: Slighty extended w.r.t. the grepping of
+ Automake stderr. Some unrelated cosmetic changes.
+
Testsuite: ensure verbose printing of captured stderr.
* tests/acloca18.test: Print captured stderr before either failing
or grepping it. Be sure to send captured stderr to stderr, not to
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
data_DATA += doz
END
-: > zar
-: > doz
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
$FGREP 'zar doz' Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 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
set -e
-cat >>configure.in <<EOF
-AM_CONDITIONAL(A, true)
-AM_CONDITIONAL(B, false)
+cat >>configure.in << 'END'
+AM_CONDITIONAL([A], [true])
+AM_CONDITIONAL([B], [false])
AC_OUTPUT
-EOF
+END
cat > Makefile.am << 'END'
foo = 0.h
b1.h
endif
+.PHONY: print
print:
@echo BEG: $(foo) :END
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE
+
./configure
-$MAKE print >stdout
+$MAKE print >stdout || { cat stdout; Exit 1; }
cat stdout
-grep 'BEG: 0.h a0.h a1.h a2.h a3.h :END' stdout
+$FGREP 'BEG: 0.h a0.h a1.h a2.h a3.h :END' stdout
+
+:
#! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 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
-echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([CHECK], [true])
+END
cat > Makefile.am << 'END'
END
-: > zar
-: > doz
-: > dog
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-grep 'CHECK_TRUE.*zar doz' Makefile.in || Exit 1
+$ACLOCAL
+$AUTOMAKE
+grep 'CHECK_TRUE.*zar doz' Makefile.in
grep 'CHECK_FALSE.*dog' Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2001, 2002, 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
. ./defs || Exit 1
-echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([CHECK], [true])
+END
cat > Makefile.am << 'END'
END
-: > zar
-: > doz
-: > dog
-
-set -e
-
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
grep '^@CHECK_TRUE@data_DATA = zarrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr \\$' Makefile.in
grep '^@CHECK_FALSE@data_DATA = dog$' Makefile.in
-Exit 0
+:
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
-echo AC_PROG_CC >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
cat > Makefile.am << 'END'
bin_PROGRAMS = foo
CC += -Dwhatever
END
-: > foo.c
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
$FGREP '@CC@ -Dwhatever' Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
-echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in
+cat >> configure.in << 'END'
+AM_CONDITIONAL([CHECK], [true])
+END
cat > Makefile.am << 'END'
if CHECK
grep AM_CPPFLAGS stderr && Exit 1
# !CHECK should still be mentioned.
grep ':.*!CHECK$' stderr
+
+:
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
-echo 'AC_SUBST(ZZZ)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([ZZZ])
+END
# If you do this in a real Makefile.am, I will kill you.
cat > Makefile.am << 'END'
zq = zzz
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-$FGREP '@mandir@ foo' Makefile.in || Exit 1
+$ACLOCAL
+$AUTOMAKE
+$FGREP '@mandir@ foo' Makefile.in
num=`grep '^mandir =' Makefile.in | wc -l`
test $num -eq 1
+
+:
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
AR += qq
END
-: > q.c
-
$ACLOCAL
AUTOMAKE_fails
grep 'Makefile.am:3:.*AR' stderr
+
+:
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2004, 2006, 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
+
cat > Makefile.am << 'END'
VAR = \
one \
VAR += three
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
sed -n -e '/^VAR =/ {
:loop
p
n
}' Makefile.in | grep three
+
+:
#! /bin/sh
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 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 <<EOF
-AM_CONDITIONAL(COND1, true)
-AM_CONDITIONAL(COND2, true)
-AM_CONDITIONAL(COND3, true)
-EOF
+cat >>configure.in << 'END'
+AM_CONDITIONAL([COND1], [true])
+AM_CONDITIONAL([COND2], [true])
+AM_CONDITIONAL([COND3], [true])
+END
cat > Makefile.am << 'END'
if COND1
# COND1_FALSE (merging the last two conditions), so we'll support
# this case in the check too.
+grep '[cC]annot apply.*+=' stderr
grep ': !COND1 and !COND3$' stderr
# Make sure there is exactly one missing condition.
test `grep ': ' stderr | wc -l` = 1
+
+: