From 4a709b8a432a4e5619e526c4c313902c834770b4 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 14 Jul 2010 14:01:43 +0200 Subject: [PATCH] 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. --- ChangeLog | 9 ++++++ tests/asm.test | 77 +++++++++++++++++++--------------------------- tests/asm2.test | 95 ++++++++++++++++++++++++--------------------------------- tests/asm3.test | 90 ++++++++++++++++++++++-------------------------------- 4 files changed, 118 insertions(+), 153 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1cb38f..b18c571 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-08-08 Stefano Lattarini + 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. diff --git a/tests/asm.test b/tests/asm.test index 6c0aa3d..f1bcb76 100755 --- a/tests/asm.test +++ b/tests/asm.test @@ -1,5 +1,5 @@ #! /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 @@ -14,31 +14,30 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# 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 @@ -48,51 +47,42 @@ grep AM_PROG_AS stderr # 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 @@ -100,16 +90,13 @@ $AUTOMAKE 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 +: diff --git a/tests/asm2.test b/tests/asm2.test index 8afd4f9..ab141e7 100755 --- a/tests/asm2.test +++ b/tests/asm2.test @@ -1,5 +1,6 @@ #! /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 @@ -14,31 +15,30 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# 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 @@ -48,70 +48,58 @@ grep AM_PROG_AS stderr # 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 @@ -119,16 +107,13 @@ $AUTOMAKE 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 +: diff --git a/tests/asm3.test b/tests/asm3.test index 0738d6a..5c42c48 100755 --- a/tests/asm3.test +++ b/tests/asm3.test @@ -16,30 +16,29 @@ # along with this program. If not, see . # 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 @@ -49,70 +48,58 @@ grep AM_PROG_AS stderr # 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 @@ -120,16 +107,13 @@ $AUTOMAKE 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 +: -- 2.7.4