* tests/subobjname.test: Add trailing `:' command.
* tests/subobj.test: Make grepping of `Makefile.in' stricter.
Escape literal dots in grep regexps.
* tests/subobj2.test: Add trailing `:' command. Do not use the
unportable fgrep option `-e'.
* tests/subobj3.test: Add trailing `:' command.
(configure.in): Use proper m4 quoting, and avoid obsolescent
constructs.
* tests/subobj8.test: Likewise. Also, enable `errexit' shell
flag, with related changes
* tests/subobj4.test: Likewise. Also, make grepping of
`Makefile.in' stricter.
* tests/subobj5.test: Add trailing `:' command. Move setting of
`errexit' shell flag earlier in the script (just after inclusion
of ./defs).
(configure.in): Use the stub created by `./defs', rather than
writing it from scratch, and avoid obsolescent constructs.
* tests/subobj6.test: Add trailing `:' command. Move setting of
`errexit' shell flag earlier in the script (just after inclusion
of ./defs). Do not create useless dummy ac-init file `f'.
* tests/subobj7.test: Do not create useless dummy ac-init file
`f'.
(configure.in): Use the stub created by `./defs', rather than
writing it from scratch, and avoid obsolescent constructs.
* tests/subobj9.test: Move setting of `errexit' shell flag earlier
in the script (just after inclusion of ./defs). Fail the test if
`make distcheck' fails. Ensure verbose printing of captured make
stdout. Avoid uselsss fork by doing simple grep instead of using
test -n "`COMMAND | grep ...`".
(configure.in): Normalize the call to AC_INIT w.r.t. other tests.
(Makefile.am): Explicitly mark target "print" as phony.
* tests/subobj10.test: Removed duplicated call to `set -e'. Add
trailing `:' command.
(configure.in): Normalize the call to AC_INIT w.r.t. other tests.
2010-08-08 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Modernize, improve and extend tests `subobj*.test'.
+ * tests/subobjname.test: Add trailing `:' command.
+ * tests/subobj.test: Make grepping of `Makefile.in' stricter.
+ Escape literal dots in grep regexps.
+ * tests/subobj2.test: Add trailing `:' command. Do not use the
+ unportable fgrep option `-e'.
+ * tests/subobj3.test: Add trailing `:' command.
+ (configure.in): Use proper m4 quoting, and avoid obsolescent
+ constructs.
+ * tests/subobj8.test: Likewise. Also, enable `errexit' shell
+ flag, with related changes
+ * tests/subobj4.test: Likewise. Also, make grepping of
+ `Makefile.in' stricter.
+ * tests/subobj5.test: Add trailing `:' command. Move setting of
+ `errexit' shell flag earlier in the script (just after inclusion
+ of ./defs).
+ (configure.in): Use the stub created by `./defs', rather than
+ writing it from scratch, and avoid obsolescent constructs.
+ * tests/subobj6.test: Add trailing `:' command. Move setting of
+ `errexit' shell flag earlier in the script (just after inclusion
+ of ./defs). Do not create useless dummy ac-init file `f'.
+ * tests/subobj7.test: Do not create useless dummy ac-init file
+ `f'.
+ (configure.in): Use the stub created by `./defs', rather than
+ writing it from scratch, and avoid obsolescent constructs.
+ * tests/subobj9.test: Move setting of `errexit' shell flag earlier
+ in the script (just after inclusion of ./defs). Fail the test if
+ `make distcheck' fails. Ensure verbose printing of captured make
+ stdout. Avoid uselsss fork by doing simple grep instead of using
+ test -n "`COMMAND | grep ...`".
+ (configure.in): Normalize the call to AC_INIT w.r.t. other tests.
+ (Makefile.am): Explicitly mark target "print" as phony.
+ * tests/subobj10.test: Removed duplicated call to `set -e'. Add
+ trailing `:' command.
+ (configure.in): Normalize the call to AC_INIT w.r.t. other tests.
+
Remove a couple of obsoleted tests.
* tests/fpinstall.test: Removed.
* tests/fpinst2.test: Likewise.
grep 'install.*compile' stderr
test -f compile
-$FGREP 'generic/a.$(OBJEXT)' Makefile.in
+grep '^generic/a\.\$(OBJEXT):' Makefile.in
grep '[^/]a\.\$(OBJEXT)' Makefile.in && Exit 1
# Opportunistically test for a different bug.
-grep '^generic/b.\$(OBJEXT):.*dirstamp' Makefile.in
+grep '^generic/b\.\$(OBJEXT):.*dirstamp' Makefile.in
:
set -e
-cat > configure.in << 'END'
-AC_INIT(x, 0, x)
+cat > configure.in << END
+AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE([subdir-objects])
AM_PROG_AS
: >src/c.s
: >d.s
-set -e
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
$MAKE
$MAKE distcheck
+
+:
#! /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
$FGREP 'generic/a.$(OBJEXT)' Makefile.in
grep '[^/]a\.\$(OBJEXT)' Makefile.in && Exit 1
-$FGREP -e '-c -o' Makefile.in
+grep '.*-c -o' Makefile.in
+
+:
#! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
-# Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 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
set -e
-cat > configure.in << 'END'
-AC_INIT(sub/hello.c)
+cat > configure.in << END
+AC_INIT([$me], [1.0])
dnl Prevent automake from looking in .. and ../..
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE(hello,0.23)
+AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_CC_STDC
AM_PROG_CC_C_O
AM_C_PROTOTYPES
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
./configure
ANSI2KNR=./ansi2knr U=_ $MAKE -e
./hello
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
-AC_OUTPUT(d1/Makefile d2/Makefile)
+AC_CONFIG_FILES([d1/Makefile d2/Makefile])
+AC_OUTPUT
END
mkdir d1 d2
: > compile
: > d2/z.c
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '\$(CC) .*\.\./d2/z\.c' d1/Makefile.in
-grep 'CC.*z' d1/Makefile.in
+:
#! /bin/sh
-# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
-cat > configure.in << 'END'
-AC_INIT(generic/a.c)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([generic/Makefile])
AC_PROG_CC
AM_PROG_CC_C_O
-AC_OUTPUT(Makefile generic/Makefile)
+AC_OUTPUT
END
cat > Makefile.am << 'END'
: > generic/a.c
: > generic/Makefile.am
-set -e
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE --include-deps --copy --add-missing
+
./configure
+
$MAKE dist
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 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
required=gcc
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AM_PROG_CC_C_O
AC_OUTPUT
test ! -f generic/$(am__dirstamp)
END
-# The ac-init file.
-: > f
-
mkdir generic
cat > generic/a.c << 'END'
#include <stdio.h>
}
END
-set -e
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE --include-deps --copy --add-missing
../configure
$MAKE
$MAKE mostlyclean
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
set -e
-cat > configure.in << 'END'
-AC_INIT(f)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
AC_PROG_CC
AM_PROG_CC_C_O
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
cat > Makefile.am << 'END'
#! /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
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AC_CONFIG_AUX_DIR(tools)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([tools])
+AM_INIT_AUTOMAKE
AC_PROG_CC
AM_PROG_CC_C_O
-AC_OUTPUT(Makefile foo/Makefile)
+AC_CONFIG_FILES([Makefile foo/Makefile])
+AC_OUTPUT
END
mkdir tools foo foo/bar
SUBDIRS = foo
END
-cat > foo/Makefile.am << 'EOF'
+cat > foo/Makefile.am << 'END'
AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = mumble
mumble_SOURCES = bar/a.c
-EOF
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+test -f tools/compile
-$ACLOCAL || Exit 1
-$AUTOMAKE --add-missing || Exit 1
-test -f tools/compile || Exit 1
+:
required='libtoolize g++'
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(x, 0, x)
-AM_INIT_AUTOMAKE([subdir-objects])
+set -e
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_CXX
AM_PROG_LIBTOOL
-
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
cat > Makefile.am << 'END'
noinst_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = src/foo.cc .//src/bar.cc # the `.//' is meant.
-
+.PHONY: print
print:
@echo BEG1: "$(LTCXXCOMPILE)" :1END
@echo BEG2: "$(CXXLINK)" :2END
}
END
-set -e
libtoolize --force
$ACLOCAL
# Skip this test on configure errors (e.g., broken C++ compilers).
./configure || Exit 77
-# opportunistically check that --tag=CXX is used when supported
-if test -n "`./libtool --help | grep tag=TAG`"; then
- $MAKE print >stdout
+# Opportunistically check that --tag=CXX is used when supported.
+if ./libtool --help | grep tag=TAG; then
+ $MAKE print >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'BEG1: .*--tag=CXX.*--mode=compile.* :1END' stdout
grep 'BEG2: .*--tag=CXX.*--mode=link.* :2END' stdout
fi
$MAKE
-$MAKE distcheck 2>&1 | tee out
+$MAKE distcheck >output 2>&1 || { cat output; Exit 1; }
+cat output
# GNU Make used to complain that the Makefile contained two rules
# for `src/.dirstamp' and `.//src/.dirstamp'.
-grep 'overriding commands' out && Exit 1
+grep 'overriding commands' output && Exit 1
+
:
#! /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
p
}' Makefile.in`
test "$cobj" = "$dobj"
+
+: