diff options
Diffstat (limited to 't/yacc-line.sh')
-rw-r--r-- | t/yacc-line.sh | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/t/yacc-line.sh b/t/yacc-line.sh index 6bf349f17..326ff8a96 100644 --- a/t/yacc-line.sh +++ b/t/yacc-line.sh @@ -15,43 +15,26 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. # Check that automake yacc support ensures that yacc-generated C -# files use correct "#line" directives. Try also with the -# 'subdir-object' option enabled. -# See also sister test 'lex-line.sh'. +# files use correct "#line" directives. +# See also sister test 'lex-line.test'. required='cc yacc' . test-init.sh cat >> configure.ac << 'END' -AC_CONFIG_FILES([sub/Makefile]) AC_PROG_CC AC_PROG_YACC AC_OUTPUT END -mkdir dir sub sub/dir +mkdir dir cat > Makefile.am << 'END' -SUBDIRS = sub -bin_PROGRAMS = foo bar -AM_YFLAGS = -d -bar_YFLAGS = +noinst_PROGRAMS = foo bar baz +baz_YFLAGS = -d foo_SOURCES = zardoz.y bar_SOURCES = dir/quux.y -## Avoid spurious failures with Solaris make. -zardoz.@OBJEXT@: zardoz.c -bar-quux.@OBJEXT@: bar-quux.c -END - -cat > sub/Makefile.am << 'END' -AUTOMAKE_OPTIONS = subdir-objects -noinst_PROGRAMS = foo bar -foo_YFLAGS = -d -foo_SOURCES = zardoz.y -bar_SOURCES = dir/quux.y -## Avoid spurious failures with Solaris make. -foo-zardoz.@OBJEXT@: foo-zardoz.c -dir/quux.@OBJEXT@: dir/quux.c +baz_SOURCES = zardoz.y END cat > zardoz.y << 'END' @@ -69,10 +52,8 @@ int main(void) END cp zardoz.y dir/quux.y -cp zardoz.y sub/zardoz.y -cp zardoz.y sub/dir/quux.y -c_outputs='zardoz.c bar-quux.c sub/foo-zardoz.c sub/dir/quux.c' +c_outputs='zardoz.c dir/quux.c baz-zardoz.c' $ACLOCAL $AUTOCONF @@ -94,7 +75,7 @@ for vpath in : false; do $MAKE # For debugging, - ls -l . sub sub/dir + ls -l . dir $EGREP 'line|\.y' $c_outputs # Adjusted "#line" should not contain reference to the builddir. @@ -109,14 +90,12 @@ for vpath in : false; do grep "#.*\.y.*\.y" $c_outputs && exit 1 if $vpath; then grep '#.*line.*"\.\./zardoz\.y"' zardoz.c - grep '#.*line.*"\.\./dir/quux\.y"' bar-quux.c - grep '#.*line.*"\.\./\.\./sub/zardoz\.y"' sub/foo-zardoz.c - grep '#.*line.*"\.\./\.\./sub/dir/quux\.y"' sub/dir/quux.c + grep '#.*line.*"\.\./zardoz\.y"' baz-zardoz.c + grep '#.*line.*"\.\./dir/quux\.y"' dir/quux.c else grep '#.*line.*"zardoz\.y"' zardoz.c - grep '#.*line.*"dir/quux\.y"' bar-quux.c - grep '#.*line.*"zardoz\.y"' sub/foo-zardoz.c - grep '#.*line.*"dir/quux\.y"' sub/dir/quux.c + grep '#.*line.*"zardoz\.y"' baz-zardoz.c + grep '#.*line.*"dir/quux\.y"' dir/quux.c fi cd $srcdir |