* tests/link_c_cxx.test: Enable `errexit shell flag, and related changes. Also, do not create useless source files. * tests/link_dist.test: Likewise. * tests/link_f90_only.test: Likewise. * tests/link_f_only.test: Likewise. * tests/link_fc.test: Likewise. * tests/link_fccxx.test: Likewise. * tests/link_fcxx.test: Likewise.
From 714ee809b016d13a75b89d8e99bc584c07b405a1 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Sat, 8 May 2010 02:25:50 +0200 Subject: [PATCH] Improve tests link*.test (enable `set -e').
* tests/link_c_cxx.test: Enable `errexit shell flag, and related changes. Also, do not create useless source files. * tests/link_dist.test: Likewise. * tests/link_f90_only.test: Likewise. * tests/link_f_only.test: Likewise. * tests/link_fc.test: Likewise. * tests/link_fccxx.test: Likewise. * tests/link_fcxx.test: Likewise. --- ChangeLog | 12 ++++++++++++ tests/link_c_cxx.test | 14 ++++++-------- tests/link_dist.test | 14 ++++++-------- tests/link_f90_only.test | 14 +++++++------- tests/link_f_only.test | 14 +++++++------- tests/link_fc.test | 15 +++++++-------- tests/link_fccxx.test | 16 +++++++--------- tests/link_fcxx.test | 15 +++++++-------- 8 files changed, 59 insertions(+), 55 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71b0d9b..dc9688f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-05-08 Stefano Lattarini <stefano.lattar...@gmail.com> + + Improve tests link*.test (enable `errexit' shell flag). + * tests/link_c_cxx.test: Enable `errexit shell flag, and related + changes. Also, do not create useless source files. + * tests/link_dist.test: Likewise. + * tests/link_f90_only.test: Likewise. + * tests/link_f_only.test: Likewise. + * tests/link_fc.test: Likewise. + * tests/link_fccxx.test: Likewise. + * tests/link_fcxx.test: Likewise. + 2010-04-25 Ralf Wildenhues <ralf.wildenh...@gmx.de> Warning and error message formatting cleanups. diff --git a/tests/link_c_cxx.test b/tests/link_c_cxx.test index 37b27d7..d1a093c 100755 --- a/tests/link_c_cxx.test +++ b/tests/link_c_cxx.test @@ -1,5 +1,5 @@ #! /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 @@ -19,6 +19,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CC AC_PROG_CXX @@ -29,18 +31,14 @@ bin_PROGRAMS = lavalamp lavalamp_SOURCES = lava.c lamp.cxx END -: > lava.c -: > lamp.cxx - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 - +$ACLOCAL +$AUTOMAKE # We should only see the C++ linker in the rules of `Makefile.in'. # Look for this macro not at the beginning of any line; that will have # to be good enough for now. -grep '.\$(CXXLINK)' Makefile.in || Exit 1 +grep '.\$(CXXLINK)' Makefile.in # We should not see these patterns: grep '.\$(FLINK)' Makefile.in && Exit 1 diff --git a/tests/link_dist.test b/tests/link_dist.test index 7e73cc3..661d683 100755 --- a/tests/link_dist.test +++ b/tests/link_dist.test @@ -1,5 +1,5 @@ #! /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 @@ -20,6 +20,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CC AC_PROG_CXX @@ -31,18 +33,14 @@ lavalamp_SOURCES = lava.c dist_lavalamp_SOURCES = lamp.cxx END -: > lava.c -: > lamp.cxx - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 - +$ACLOCAL +$AUTOMAKE # We should only see the C++ linker in the rules of `Makefile.in'. # Look for this macro not at the beginning of any line; that will have # to be good enough for now. -grep '.\$(CXXLINK)' Makefile.in || Exit 1 +grep '.\$(CXXLINK)' Makefile.in # We should not see these patterns: grep '.\$(FLINK)' Makefile.in && Exit 1 diff --git a/tests/link_f90_only.test b/tests/link_f90_only.test index eeec3a6..979eb67 100755 --- a/tests/link_f90_only.test +++ b/tests/link_f90_only.test @@ -1,5 +1,6 @@ #! /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 @@ -19,6 +20,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_FC END @@ -28,17 +31,14 @@ bin_PROGRAMS = lavalamp lavalamp_SOURCES = lamp.f90 END -: > lamp.f90 - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 - +$ACLOCAL +$AUTOMAKE # We should only see the Fortran linker in the rules of `Makefile.in'. # Look for this macro not at the beginning of any line; that will have # to be good enough for now. -grep '.\$(FCLINK)' Makefile.in || Exit 1 +grep '.\$(FCLINK)' Makefile.in # We should not see these patterns: grep '.\$(CXXLINK)' Makefile.in && Exit 1 diff --git a/tests/link_f_only.test b/tests/link_f_only.test index 4390bd6..c4df8ce 100755 --- a/tests/link_f_only.test +++ b/tests/link_f_only.test @@ -1,5 +1,6 @@ #! /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 @@ -19,6 +20,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_F77 END @@ -28,17 +31,14 @@ bin_PROGRAMS = lavalamp lavalamp_SOURCES = lamp.f END -: > lamp.f - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 - +$ACLOCAL +$AUTOMAKE # We should only see the Fortran linker in the rules of `Makefile.in'. # Look for this macro not at the beginning of any line; that will have # to be good enough for now. -grep '.\$(F77LINK)' Makefile.in || Exit 1 +grep '.\$(F77LINK)' Makefile.in # We should not see these patterns: grep '.\$(CXXLINK)' Makefile.in && Exit 1 diff --git a/tests/link_fc.test b/tests/link_fc.test index 5b23bd5..8c80f8c 100755 --- a/tests/link_fc.test +++ b/tests/link_fc.test @@ -1,5 +1,6 @@ #! /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 @@ -19,6 +20,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CC AC_PROG_F77 @@ -29,19 +32,15 @@ bin_PROGRAMS = lavalamp lavalamp_SOURCES = lava.c lamp.f END -: > lava.c -: > lamp.f - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 - +$ACLOCAL +$AUTOMAKE # We should only see the Fortran 77 linker in the rules of # `Makefile.in'. # Look for this macro not at the beginning of any line; that will have # to be good enough for now. -grep '.\$(F77LINK)' Makefile.in || Exit 1 +grep '.\$(F77LINK)' Makefile.in # We should not see these patterns: grep '.\$(LINK)' Makefile.in && Exit 1 diff --git a/tests/link_fccxx.test b/tests/link_fccxx.test index bd2b21d..30263d0 100755 --- a/tests/link_fccxx.test +++ b/tests/link_fccxx.test @@ -1,5 +1,6 @@ #! /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 @@ -19,6 +20,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CC AC_PROG_CXX @@ -30,19 +33,14 @@ bin_PROGRAMS = lavalamp lavalamp_SOURCES = lava.c lamp.cxx lamp2.f END -: > lava.c -: > lamp.cxx -: > lamp2.f - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 - +$ACLOCAL +$AUTOMAKE # We should only see the C++ linker in the rules of `Makefile.in'. # Look for this macro not at the beginning of any line; that will have # to be good enough for now. -grep '.\$(CXXLINK)' Makefile.in || Exit 1 +grep '.\$(CXXLINK)' Makefile.in # We should not see these patterns: grep '.\$(F77LINK)' Makefile.in && Exit 1 diff --git a/tests/link_fcxx.test b/tests/link_fcxx.test index e86f7cd..c75ffc7 100755 --- a/tests/link_fcxx.test +++ b/tests/link_fcxx.test @@ -1,5 +1,6 @@ #! /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 @@ -19,6 +20,8 @@ . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CXX AC_PROG_F77 @@ -29,18 +32,14 @@ bin_PROGRAMS = lavalamp lavalamp_SOURCES = lava.cxx lamp.f END -: > lava.cxx -: > lamp.f - -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 - +$ACLOCAL +$AUTOMAKE # We should only see the C++ linker in the rules of `Makefile.in'. # Look for this macro not at the beginning of any line; that will have # to be good enough for now. -grep '.\$(CXXLINK)' Makefile.in || Exit 1 +grep '.\$(CXXLINK)' Makefile.in # We should not see these patterns: grep '.\$(F77LINK)' Makefile.in && Exit 1 -- 1.6.5