From 3492f226311377857a54032e43e1a982e7d804bc Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 19 Jun 2013 11:46:42 +0200 Subject: tests: more significant names for some tests * t/extra2.sh: Rename... * t/extra-sources-no-spurious.sh: ... like this. * t/yflags2.sh: Rename... * t/yflags-cxx.sh: ... like this. * t/lflags2.sh: Rename... * t/lflags-cxx.sh: ... like this. Signed-off-by: Stefano Lattarini --- t/extra-sources-no-spurious.sh | 34 +++++++++++++++++++++ t/extra2.sh | 34 --------------------- t/lflags-cxx.sh | 68 ++++++++++++++++++++++++++++++++++++++++++ t/lflags2.sh | 68 ------------------------------------------ t/list-of-tests.mk | 6 ++-- t/yflags-cxx.sh | 66 ++++++++++++++++++++++++++++++++++++++++ t/yflags2.sh | 66 ---------------------------------------- 7 files changed, 171 insertions(+), 171 deletions(-) create mode 100644 t/extra-sources-no-spurious.sh delete mode 100644 t/extra2.sh create mode 100644 t/lflags-cxx.sh delete mode 100644 t/lflags2.sh create mode 100644 t/yflags-cxx.sh delete mode 100644 t/yflags2.sh diff --git a/t/extra-sources-no-spurious.sh b/t/extra-sources-no-spurious.sh new file mode 100644 index 000000000..f3c3f5bdb --- /dev/null +++ b/t/extra-sources-no-spurious.sh @@ -0,0 +1,34 @@ +#! /bin/sh +# Copyright (C) 1996-2013 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check to make sure EXTRA_foo_SOURCES are not defined unnecessarily. + +. test-init.sh + +cat >> configure.ac << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +END + +$ACLOCAL +$AUTOMAKE + +grep EXTRA_foo_SOURCES Makefile.in && exit 1 + +: diff --git a/t/extra2.sh b/t/extra2.sh deleted file mode 100644 index f3c3f5bdb..000000000 --- a/t/extra2.sh +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh -# Copyright (C) 1996-2013 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Check to make sure EXTRA_foo_SOURCES are not defined unnecessarily. - -. test-init.sh - -cat >> configure.ac << 'END' -AC_PROG_CC -END - -cat > Makefile.am << 'END' -bin_PROGRAMS = foo -END - -$ACLOCAL -$AUTOMAKE - -grep EXTRA_foo_SOURCES Makefile.in && exit 1 - -: diff --git a/t/lflags-cxx.sh b/t/lflags-cxx.sh new file mode 100644 index 000000000..bcc42c767 --- /dev/null +++ b/t/lflags-cxx.sh @@ -0,0 +1,68 @@ +#! /bin/sh +# Copyright (C) 2010-2013 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that $(LFLAGS) takes precedence over both $(AM_LFLAGS) and +# $(foo_LFLAGS). +# Please keep this in sync with the sister tests lflags.sh, yflags.sh +# and yflags2.sh. + +. test-init.sh + +cat >fake-lex <<'END' +#!/bin/sh +echo '/*' "$*" '*/' >lex.yy.c +echo 'extern int dummy;' >> lex.yy.c +END +chmod a+x fake-lex + +cat >> configure.ac <<'END' +AC_SUBST([CXX], [false]) +# Simulate presence of Lex using our fake-lex script. +AC_SUBST([LEX], ['$(abs_top_srcdir)'/fake-lex]) +AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy]) +AC_SUBST([LEXLIB], ['']) +AC_OUTPUT +END + +cat > Makefile.am <<'END' +AUTOMAKE_OPTIONS = no-dependencies +bin_PROGRAMS = foo bar +foo_SOURCES = main.cc foo.ll +bar_SOURCES = main.cc bar.l++ +AM_LFLAGS = __am_flags__ +bar_LFLAGS = __bar_flags__ +END + +$ACLOCAL +$AUTOMAKE -a + +grep '\$(LFLAGS).*\$(bar_LFLAGS)' Makefile.in && exit 1 +grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && exit 1 + +: > foo.ll +: > bar.l++ + +$AUTOCONF +./configure +run_make LFLAGS=__user_flags__ foo.cc bar-bar.c++ + +cat foo.cc +cat bar-bar.c++ + +grep '__am_flags__.*__user_flags__' foo.cc +grep '__bar_flags__.*__user_flags__' bar-bar.c++ + +: diff --git a/t/lflags2.sh b/t/lflags2.sh deleted file mode 100644 index bcc42c767..000000000 --- a/t/lflags2.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /bin/sh -# Copyright (C) 2010-2013 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Check that $(LFLAGS) takes precedence over both $(AM_LFLAGS) and -# $(foo_LFLAGS). -# Please keep this in sync with the sister tests lflags.sh, yflags.sh -# and yflags2.sh. - -. test-init.sh - -cat >fake-lex <<'END' -#!/bin/sh -echo '/*' "$*" '*/' >lex.yy.c -echo 'extern int dummy;' >> lex.yy.c -END -chmod a+x fake-lex - -cat >> configure.ac <<'END' -AC_SUBST([CXX], [false]) -# Simulate presence of Lex using our fake-lex script. -AC_SUBST([LEX], ['$(abs_top_srcdir)'/fake-lex]) -AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy]) -AC_SUBST([LEXLIB], ['']) -AC_OUTPUT -END - -cat > Makefile.am <<'END' -AUTOMAKE_OPTIONS = no-dependencies -bin_PROGRAMS = foo bar -foo_SOURCES = main.cc foo.ll -bar_SOURCES = main.cc bar.l++ -AM_LFLAGS = __am_flags__ -bar_LFLAGS = __bar_flags__ -END - -$ACLOCAL -$AUTOMAKE -a - -grep '\$(LFLAGS).*\$(bar_LFLAGS)' Makefile.in && exit 1 -grep '\$(LFLAGS).*\$(AM_LFLAGS)' Makefile.in && exit 1 - -: > foo.ll -: > bar.l++ - -$AUTOCONF -./configure -run_make LFLAGS=__user_flags__ foo.cc bar-bar.c++ - -cat foo.cc -cat bar-bar.c++ - -grep '__am_flags__.*__user_flags__' foo.cc -grep '__bar_flags__.*__user_flags__' bar-bar.c++ - -: diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 80c2f0942..1aebce50d 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -448,7 +448,7 @@ t/ext.sh \ t/ext2.sh \ t/ext3.sh \ t/extra.sh \ -t/extra2.sh \ +t/extra-sources-no-spurious.sh \ t/extra-data.sh \ t/extra-dist-vpath-dir.sh \ t/extra-dist-dirs-and-subdirs.sh \ @@ -591,7 +591,7 @@ t/lex-line.sh \ t/lex-nodist.sh \ t/lex-pr204.sh \ t/lflags.sh \ -t/lflags2.sh \ +t/lflags-cxx.sh \ t/libexec.sh \ t/libobj-basic.sh \ t/libobj2.sh \ @@ -1295,7 +1295,7 @@ t/yacc-pr204.sh \ t/yacc-subdir.sh \ t/yacc-weirdnames.sh \ t/yflags.sh \ -t/yflags2.sh \ +t/yflags-cxx.sh \ t/yflags-cmdline-override.sh \ t/yflags-conditional.sh \ t/yflags-d-false-positives.sh \ diff --git a/t/yflags-cxx.sh b/t/yflags-cxx.sh new file mode 100644 index 000000000..1987cace9 --- /dev/null +++ b/t/yflags-cxx.sh @@ -0,0 +1,66 @@ +#! /bin/sh +# Copyright (C) 2010-2013 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that $(YFLAGS) takes precedence over both $(AM_YFLAGS) and +# $(foo_YFLAGS). +# Please keep this in sync with the sister tests yflags.sh, lflags.sh +# and lflags2.sh. + +. test-init.sh + +cat >fake-yacc <<'END' +#!/bin/sh +echo '/*' "$*" '*/' >y.tab.c +echo 'extern int dummy;' >> y.tab.c +END +chmod a+x fake-yacc + +cat >> configure.ac <<'END' +AC_SUBST([CXX], [false]) +# Simulate presence of Yacc using our fake-yacc script. +AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc]) +AC_OUTPUT +END + +cat > Makefile.am <<'END' +AUTOMAKE_OPTIONS = no-dependencies +bin_PROGRAMS = foo bar +foo_SOURCES = main.cc foo.yy +bar_SOURCES = main.cc bar.y++ +AM_YFLAGS = __am_flags__ +bar_YFLAGS = __bar_flags__ +END + +$ACLOCAL +$AUTOMAKE -a + +grep '\$(YFLAGS).*\$(bar_YFLAGS)' Makefile.in && exit 1 +grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && exit 1 + +: > foo.yy +: > bar.y++ + +$AUTOCONF +./configure +run_make YFLAGS=__user_flags__ foo.cc bar-bar.c++ + +cat foo.cc +cat bar-bar.c++ + +grep '__am_flags__.*__user_flags__' foo.cc +grep '__bar_flags__.*__user_flags__' bar-bar.c++ + +: diff --git a/t/yflags2.sh b/t/yflags2.sh deleted file mode 100644 index 1987cace9..000000000 --- a/t/yflags2.sh +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/sh -# Copyright (C) 2010-2013 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Check that $(YFLAGS) takes precedence over both $(AM_YFLAGS) and -# $(foo_YFLAGS). -# Please keep this in sync with the sister tests yflags.sh, lflags.sh -# and lflags2.sh. - -. test-init.sh - -cat >fake-yacc <<'END' -#!/bin/sh -echo '/*' "$*" '*/' >y.tab.c -echo 'extern int dummy;' >> y.tab.c -END -chmod a+x fake-yacc - -cat >> configure.ac <<'END' -AC_SUBST([CXX], [false]) -# Simulate presence of Yacc using our fake-yacc script. -AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc]) -AC_OUTPUT -END - -cat > Makefile.am <<'END' -AUTOMAKE_OPTIONS = no-dependencies -bin_PROGRAMS = foo bar -foo_SOURCES = main.cc foo.yy -bar_SOURCES = main.cc bar.y++ -AM_YFLAGS = __am_flags__ -bar_YFLAGS = __bar_flags__ -END - -$ACLOCAL -$AUTOMAKE -a - -grep '\$(YFLAGS).*\$(bar_YFLAGS)' Makefile.in && exit 1 -grep '\$(YFLAGS).*\$(AM_YFLAGS)' Makefile.in && exit 1 - -: > foo.yy -: > bar.y++ - -$AUTOCONF -./configure -run_make YFLAGS=__user_flags__ foo.cc bar-bar.c++ - -cat foo.cc -cat bar-bar.c++ - -grep '__am_flags__.*__user_flags__' foo.cc -grep '__bar_flags__.*__user_flags__' bar-bar.c++ - -: -- cgit v1.2.1