2010-08-08 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Improve and extend tests `asm*.test'.
+ * tests/asm.test: Use configure.in stub generated by ./defs,
+ and avoid obsoleted autoconf constructs. Make grepping of
+ Automake stderr stricter. Do not create useless source file.
+ Improve verbose messages. Minor cosmetic changes. Tell to
+ keep it in sync with other sister tests asm*.test.
+ * tests/asm2.test: Likewise.
+ * tests/asm3.test: Likewise.
+
Modernize, improve and/or extend test scripts `conf*.test'.
* tests/confh5.test: Cosmetic changes.
* tests/conff.test: Likewise.
#! /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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test of basic assembly functionality
+# Test of basic assembly functionality.
+# Keep this in sync with sister tests asm2.test and asm3.test.
. ./defs || Exit 1
set -e
+mv configure.in configure.stub
+
cat > Makefile.am << 'END'
noinst_PROGRAMS = maude
maude_SOURCES = maude.s
END
-: > maude.s
-
-# Should fail because we need CC and CCAS.
-echo 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+echo '*** Try 1 -- should fail because we need CC and CCAS ***'
+cat configure.stub - > configure.in << 'END'
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCAS.* undefined' stderr
+grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
# On fast machines the autom4te.cache created during the above run of
# $AUTOMAKE is likely to have the same time stamp as the configure.in
# bogus installations of Autoconf use a versioned cache.)
rm -rf autom4te*.cache
-# We still need CCAS.
-echo 2
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 2 -- we still need CCAS ***'
+cat configure.stub - > configure.in << 'END'
AC_PROG_CC
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep CCAS stderr
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCAS.* undefined' stderr
+grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
rm -rf autom4te*.cache
-# We need CCASFLAGS.
-echo 3
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 3 -- we need CCASFLAGS ***'
+cat configure.stub - > configure.in << 'END'
CCAS='$(CC)'
-AC_SUBST(CCAS)
+AC_SUBST([CCAS])
AC_PROG_CC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep CCASFLAGS stderr
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
+grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
rm -rf autom4te*.cache
-# We have every needed, expect a success.
-echo 4
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 4 -- we have everything needed, expect success ***'
+cat configure.stub - > configure.in << 'END'
CCAS='$(CC)'
-AC_SUBST(CCAS)
+AC_SUBST([CCAS])
AC_PROG_CC
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
rm -rf autom4te*.cache
-# We have every needed, expect a success.
-echo 5
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 5 -- we have everything needed, expect success ***'
+cat configure.stub - > configure.in << 'END'
AM_PROG_AS
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
$ACLOCAL
$AUTOMAKE
-Exit 0
+:
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test of basic preprocessed assembly functionality
+# Test of basic preprocessed assembly functionality.
+# Keep this in sync with sister tests asm.test and asm3.test.
. ./defs || Exit 1
set -e
+mv configure.in configure.stub
+
cat > Makefile.am << 'END'
noinst_PROGRAMS = maude
maude_SOURCES = maude.S
END
-: > maude.s
-
-# Should fail because we need CC and CCAS.
-echo 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+echo '*** Try 1 -- should fail because we need CC and CCAS ***'
+cat configure.stub - > configure.in << 'END'
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCAS.* undefined' stderr
+grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
# On fast machines the autom4te.cache created during the above run of
# $AUTOMAKE is likely to have the same time stamp as the configure.in
# bogus installations of Autoconf use a versioned cache.)
rm -rf autom4te*.cache
-# We still need CCAS.
-echo 2
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 2 -- we still need CCAS ***'
+cat configure.stub - > configure.in << 'END'
AC_PROG_CC
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep CCAS stderr
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCAS.* undefined' stderr
+grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
rm -rf autom4te*.cache
-# We need CCASFLAGS.
-echo 3
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 3 -- we need CCASFLAGS ***'
+cat configure.stub - > configure.in << 'END'
CCAS='$(CC)'
-AC_SUBST(CCAS)
+AC_SUBST([CCAS])
AC_PROG_CC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep CCASFLAGS stderr
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
+grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
rm -rf autom4te*.cache
-# We need dependency tracking.
-echo 4
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 4 -- we need dependency tracking. ***'
+cat configure.stub - > configure.in << 'END'
CCAS='$(CC)'
-AC_SUBST(CCAS)
+AC_SUBST([CCAS])
AC_PROG_CC
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep AM_PROG_AS stderr
+grep ' add .*AM_PROG_AS' stderr
rm -rf autom4te*.cache
-# We have every needed, expect a success.
-echo 5
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 5 -- we have everything needed, expect success. ***'
+cat configure.stub - > configure.in << 'END'
CCAS='$(CC)'
-AC_SUBST(CCAS)
+AC_SUBST([CCAS])
AC_PROG_CC
-_AM_DEPENDENCIES(CCAS)
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+_AM_DEPENDENCIES([CCAS])
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
rm -rf autom4te*.cache
-# We have every needed, expect a success.
-echo 6
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 6 -- we have everything needed, expect success. ***'
+cat configure.stub - > configure.in << 'END'
AM_PROG_AS
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
$ACLOCAL
$AUTOMAKE
-Exit 0
+:
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test of basic preprocessed assembly functionality with extension .sx.
+# Keep this in sync with sister tests asm.test and asm2.test.
. ./defs || Exit 1
set -e
+mv configure.in configure.stub
+
cat > Makefile.am << 'END'
noinst_PROGRAMS = maude
maude_SOURCES = maude.sx
END
-: > maude.sx
-
-# Should fail because we need CC and CCAS.
-echo 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+echo '*** Try 1 -- should fail because we need CC and CCAS ***'
+cat configure.stub - > configure.in << 'END'
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCAS.* undefined' stderr
+grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
# On fast machines the autom4te.cache created during the above run of
# $AUTOMAKE is likely to have the same time stamp as the configure.in
# bogus installations of Autoconf use a versioned cache.)
rm -rf autom4te*.cache
-# We still need CCAS.
-echo 2
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 2 -- we still need CCAS ***'
+cat configure.stub - > configure.in << 'END'
AC_PROG_CC
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep CCAS stderr
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCAS.* undefined' stderr
+grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
rm -rf autom4te*.cache
-# We need CCASFLAGS.
-echo 3
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 3 -- we need CCASFLAGS ***'
+cat configure.stub - > configure.in << 'END'
CCAS='$(CC)'
-AC_SUBST(CCAS)
+AC_SUBST([CCAS])
AC_PROG_CC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep CCASFLAGS stderr
-grep AM_PROG_AS stderr
+grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
+grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
rm -rf autom4te*.cache
-# We need dependency tracking.
-echo 4
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 4 -- we need dependency tracking. ***'
+cat configure.stub - > configure.in << 'END'
CCAS='$(CC)'
-AC_SUBST(CCAS)
+AC_SUBST([CCAS])
AC_PROG_CC
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
AUTOMAKE_fails
-grep AM_PROG_AS stderr
+grep ' add .*AM_PROG_AS' stderr
rm -rf autom4te*.cache
-# We have every needed, expect a success.
-echo 5
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 5 -- we have everything needed, expect success. ***'
+cat configure.stub - > configure.in << 'END'
CCAS='$(CC)'
-AC_SUBST(CCAS)
+AC_SUBST([CCAS])
AC_PROG_CC
-_AM_DEPENDENCIES(CCAS)
-AC_SUBST(CCASFLAGS)
-AC_OUTPUT(Makefile)
+_AM_DEPENDENCIES([CCAS])
+AC_SUBST([CCASFLAGS])
+AC_OUTPUT
END
$ACLOCAL
rm -rf autom4te*.cache
-# We have every needed, expect a success.
-echo 6
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+echo '*** Try 6 -- we have everything needed, expect success. ***'
+cat configure.stub - > configure.in << 'END'
AM_PROG_AS
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
$ACLOCAL
$AUTOMAKE
-Exit 0
+: