Non-suffix rules aren't allowed to use the %EXT% substitution, but the yacc rules were doing so; for implementation reasons, this problems only manifested itself when Yacc was used with C++ and with different extensions (e.g., `y++' and `yxx') in the same Makefile.am.
Bug introduced in commit v1.11-402-g834ed72, and exposed by failures in `yacc-cxx.test'. This change is not completely obvious, so I'll allow 72 hours for a review before pushing. Regards, Stefano
From 3406b47a112af4016b108c2e5b9f64c7c2b351ec Mon Sep 17 00:00:00 2001 Message-Id: <3406b47a112af4016b108c2e5b9f64c7c2b351ec.1309296996.git.stefano.lattar...@gmail.com> From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Tue, 28 Jun 2011 23:20:17 +0200 Subject: [PATCH] Fix bug with non-suffix rules for C++ yacc Non-suffix rules aren't allowed to use the %EXT% substitution, but the yacc rules were doing so; for implementation reasons, this problems only manifested itself when Yacc was used with C++ and with different extensions (e.g., `y++' and `yxx') in the same Makefile.am. Bug introduced in commit v1.11-402-g834ed72, and exposed by failures in `yacc-cxx.test'. * lib/ylwrap: Automatically extract the expected C/C++ extension from that of the Yacc file, instead of having it passed as a separate argument. Modify calling convention accordingly. * lib/am/yacc.am: Adjust call to `ylwrap' not to pass the `%EXT%' argument * tests/ylwrap-chdir-back-fail.test: Adjust. * tests/ylwrap-cleanup-fail.test: Likewise. * tests/ylwrap-extra-args.test: Likewise. * tests/ylwrap-fail.test: Likewise. * tests/ylwrap-output-rename.test: Likewise. * tests/ylwrap-path-handling.test: Likewise. * tests/ylwrap-pwd-fail.test: Likewise. * tests/ylwrap-usage-fail.test: Likewise. * tests/ylwrap-yacc-dos.test: Likewise. * tests/ylwrap-yacc-ext.test: Likewise. * tests/ylwrap-yacc-parallel.test: Likewise. * tests/ylwrap-signals.test: Likewise, and fix a couple of minor buglets. * tests/yacc-basic.test: Improve debugging output, especially in case of failure. * tests/yacc-cxx.test: Likewise. * tests/yacc-d-basic.test: Likewise. * tests/yacc-d-cxx.test: Likewise. * tests/yacc-clean.test: Likewise. * tests/yacc-clean-cxx.test: Likewise. * tests/yacc-deleted-headers.test: Likewise. * tests/yacc-depend.test: Likewise. * tests/yacc-line.test: Likewise. * tests/yacc-mix-c-cxx.test: Likewise. * tests/yacc-pr204.test: Likewise. --- ChangeLog | 41 +++++++++++++++++++++++++++++++++++++ lib/am/yacc.am | 2 +- lib/ylwrap | 20 ++++++++---------- tests/yacc-basic.test | 2 +- tests/yacc-clean-cxx.test | 2 +- tests/yacc-clean.test | 2 +- tests/yacc-cxx.test | 3 +- tests/yacc-d-basic.test | 3 +- tests/yacc-d-cxx.test | 3 +- tests/yacc-deleted-headers.test | 28 ++++++++++++++++--------- tests/yacc-line.test | 5 ++- tests/yacc-mix-c-cxx.test | 17 ++++++++++----- tests/yacc-pr204.test | 1 + tests/yaccvpath.test | 4 +- tests/ylwrap-chdir-back-fail.test | 2 +- tests/ylwrap-cleanup-fail.test | 2 +- tests/ylwrap-extra-args.test | 2 +- tests/ylwrap-fail.test | 6 ++-- tests/ylwrap-output-rename.test | 10 ++++---- tests/ylwrap-path-handling.test | 6 ++-- tests/ylwrap-pwd-fail.test | 2 +- tests/ylwrap-signals.test | 8 +++--- tests/ylwrap-usage-fail.test | 12 +++++----- tests/ylwrap-yacc-dos.test | 2 +- tests/ylwrap-yacc-ext.test | 14 +++++++----- tests/ylwrap-yacc-parallel.test | 2 +- 26 files changed, 130 insertions(+), 71 deletions(-) diff --git a/ChangeLog b/ChangeLog index c98d085..268aaa5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,46 @@ 2011-06-28 Stefano Lattarini <stefano.lattar...@gmail.com> + Fix bug with non-suffix rules for C++ yacc + Non-suffix rules aren't allowed to use the %EXT% substitution, + but the yacc rules were doing so; for implementation reasons, + this problems only manifested itself when Yacc was used with C++ + and with different extensions (e.g., `y++' and `yxx') in the + same Makefile.am. + Bug introduced in commit v1.11-402-g834ed72, and exposed by + failures in `yacc-cxx.test'. + * lib/ylwrap: Automatically extract the expected C/C++ extension + from that of the Yacc file, instead of having it passed as a + separate argument. Modify calling convention accordingly. + * lib/am/yacc.am: Adjust call to `ylwrap' not to pass the `%EXT%' + argument + * tests/ylwrap-chdir-back-fail.test: Adjust. + * tests/ylwrap-cleanup-fail.test: Likewise. + * tests/ylwrap-extra-args.test: Likewise. + * tests/ylwrap-fail.test: Likewise. + * tests/ylwrap-output-rename.test: Likewise. + * tests/ylwrap-path-handling.test: Likewise. + * tests/ylwrap-pwd-fail.test: Likewise. + * tests/ylwrap-usage-fail.test: Likewise. + * tests/ylwrap-yacc-dos.test: Likewise. + * tests/ylwrap-yacc-ext.test: Likewise. + * tests/ylwrap-yacc-parallel.test: Likewise. + * tests/ylwrap-signals.test: Likewise, and fix a couple of minor + buglets. + * tests/yacc-basic.test: Improve debugging output, especially in + case of failure. + * tests/yacc-cxx.test: Likewise. + * tests/yacc-d-basic.test: Likewise. + * tests/yacc-d-cxx.test: Likewise. + * tests/yacc-clean.test: Likewise. + * tests/yacc-clean-cxx.test: Likewise. + * tests/yacc-deleted-headers.test: Likewise. + * tests/yacc-depend.test: Likewise. + * tests/yacc-line.test: Likewise. + * tests/yacc-mix-c-cxx.test: Likewise. + * tests/yacc-pr204.test: Likewise. + +2011-06-28 Stefano Lattarini <stefano.lattar...@gmail.com> + yacc tests: fix bug in 'yacc-cxx.test' * tests/yacc-cxx.test: Enable `errexit' shell flag (the lack of which was masking the bug). diff --git a/lib/am/yacc.am b/lib/am/yacc.am index a255fb2..2298645 100644 --- a/lib/am/yacc.am +++ b/lib/am/yacc.am @@ -44,7 +44,7 @@ endif %?FIRST% ?GENERIC? %VERBOSE%$(am__skipyacc) \ ?!GENERIC? %VERBOSE% \ ?!GENERIC??DIST_SOURCE? $(am__skipyacc) \ - $(SHELL) $(YLWRAP) --yacc %EXT% \ + $(SHELL) $(YLWRAP) --yacc \ ?GENERIC? %SOURCE% \ ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%. ?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% \ diff --git a/lib/ylwrap b/lib/ylwrap index e5d17b1..3e756f4 100755 --- a/lib/ylwrap +++ b/lib/ylwrap @@ -148,7 +148,7 @@ ylwrap: Wrapper for lex/yacc invocations, renaming files as desired. Usage: ylwrap {--help|--version} or: - ylwrap --yacc YACC-EXTENSION INPUT [--] PROGRAM [ARGS]... + ylwrap --yacc INPUT C-OUTPUT [--] PROGRAM [ARGS]... or: ylwrap --lex LEX-OUTPUT-ROOT INPUT OUTPUT [--] PROGRAM [ARGS]... @@ -164,14 +164,12 @@ EOF wrapped=yacc shift case $# in - 0) usage_error "missing yacc extension";; - 1) usage_error "missing input file";; - 2) usage_error "missing output file";; + 0) usage_error "missing input file";; + 1) usage_error "missing output file";; esac - y_ext=`expr x"$1" : x'\.\(.*\)'` - input=$2 - output=$3 - shift 3 + input=$1 + output=$2 + shift 2 ;; --lex) wrapped=lex @@ -250,9 +248,9 @@ input_rx=`quote_for_sed "$input_dir"` case $wrapped in yacc) - c_ext=`echo $y_ext | tr 'y' 'c'` - h_ext=`echo $y_ext | tr 'y' 'h'` - output_stem=`echo "$output" | sed "s/\\\\.$c_ext$//"` + output_stem=`echo "$output" | sed "s/\\\\.[^.]*$//"` + c_ext=`expr ."$output" : ".*\\\\.\\\\([^.]*\\\\)$"` + h_ext=`echo $c_ext | tr 'c' 'h'` tempfile_deploy $y_tab_c $output_stem.$c_ext # If the `-d' option is not used, we don't want an error when the # header file is "missing". Similarly, if `-v' is not used, we diff --git a/tests/yacc-basic.test b/tests/yacc-basic.test index d562b7f..167126c 100755 --- a/tests/yacc-basic.test +++ b/tests/yacc-basic.test @@ -59,7 +59,7 @@ $AUTOCONF $AUTOMAKE -a ./configure -$MAKE +$MAKE || { ls -l; Exit 1; } ls -l # The Yacc-derived C sources must be created, and not removed once # compiled (i.e., not treated like "intermediate files" in the GNU diff --git a/tests/yacc-clean-cxx.test b/tests/yacc-clean-cxx.test index 96ceaf8..6ef80d1 100755 --- a/tests/yacc-clean-cxx.test +++ b/tests/yacc-clean-cxx.test @@ -102,7 +102,7 @@ $AUTOMAKE -a cp config.status config.sav -$MAKE +$MAKE || { ls -l . sub1 sub2; Exit 1; } ls -l . sub1 sub2 # Sanity checks. test -f sub1/parsefoo.cxx diff --git a/tests/yacc-clean.test b/tests/yacc-clean.test index bdc8dd0..5754fbc 100755 --- a/tests/yacc-clean.test +++ b/tests/yacc-clean.test @@ -91,7 +91,7 @@ $AUTOMAKE -a cp config.status config.sav -$MAKE +$MAKE || { ls -l . sub1 sub2; Exit 1; } ls -l . sub1 sub2 # Sanity checks. test -f sub1/parse.y diff --git a/tests/yacc-cxx.test b/tests/yacc-cxx.test index e4afd95..f9ad5ed 100755 --- a/tests/yacc-cxx.test +++ b/tests/yacc-cxx.test @@ -77,7 +77,8 @@ $AUTOMAKE -a ./configure -$MAKE +$MAKE || { ls -l; Exit 1; } +ls -l # The Yacc-derived C++ sources must be created, and not removed once # compiled (i.e., not treated like "intermediate files" in the GNU diff --git a/tests/yacc-d-basic.test b/tests/yacc-d-basic.test index 17750cd..4b9ceb7 100755 --- a/tests/yacc-d-basic.test +++ b/tests/yacc-d-basic.test @@ -100,7 +100,8 @@ $AUTOMAKE baz/Makefile ./configure -$MAKE +$MAKE || { ls -l; Exit 1; } +ls -l test -f foo/parse.c test -f foo/parse.h diff --git a/tests/yacc-d-cxx.test b/tests/yacc-d-cxx.test index 599b6ca..41a26e5 100755 --- a/tests/yacc-d-cxx.test +++ b/tests/yacc-d-cxx.test @@ -152,8 +152,9 @@ write_main maude-parse.hxx > qux/main.cxx ./configure -$MAKE +st=0; $MAKE || st=$? ls -l . foo bar baz baz/sub qux # For debugging. +test $st -eq 0 || Exit 1 test -f foo/parse.cc test -f foo/parse.hh diff --git a/tests/yacc-deleted-headers.test b/tests/yacc-deleted-headers.test index 6d6a0a1..9157140 100755 --- a/tests/yacc-deleted-headers.test +++ b/tests/yacc-deleted-headers.test @@ -98,29 +98,37 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a +do_make () +{ + st=0 + $MAKE $* || st=$? + ls -l + test $st -eq 0 || Exit $st +} + ./configure -$MAKE +do_make headers='parse1.h p2-parse2.h parse3.h parse4.h' # Check that we remake only the necessary headers. rm -f $headers -$MAKE parse1.h +do_make parse1.h test -f parse1.h test ! -r p2-parse2.h test ! -r parse3.h test ! -r parse4.h rm -f $headers -$MAKE p2-parse2.h +do_make p2-parse2.h test ! -r parse1.h test -f p2-parse2.h test ! -r parse3.h test ! -r parse4.h rm -f $headers -$MAKE parse3.h +do_make parse3.h test ! -r parse1.h test ! -r p2-parse2.h test -f parse3.h @@ -128,15 +136,15 @@ test ! -r parse4.h # Since we declared parse3.h into $(p3_SOURCES), make should be # able to rebuild it automatically before remaking `p3'. rm -f $headers -$MAKE clean-p3 +do_make clean-p3 test ! -f parse3.h # Sanity check. -$MAKE build-p3 +do_make build-p3 test -f parse3.h -$MAKE +do_make rm -f $headers -$MAKE parse4.h +do_make parse4.h test ! -r parse1.h test ! -r p2-parse2.h test ! -r parse3.h @@ -145,7 +153,7 @@ test -f parse4.h # Now remake all the headers together. rm -f $headers -$MAKE $headers +do_make $headers test -f parse1.h test -f p2-parse2.h test -f parse3.h @@ -154,7 +162,7 @@ test -f parse4.h # Most headers should be remade by "make all". rm -f $headers -$MAKE all +do_make all test -f parse1.h test -f p2-parse2.h test -f parse3.h diff --git a/tests/yacc-line.test b/tests/yacc-line.test index f760b72..eef5d7a 100755 --- a/tests/yacc-line.test +++ b/tests/yacc-line.test @@ -93,11 +93,12 @@ for vpath in : false; do fi $srcdir/configure - $MAKE - + st=0 + $MAKE || st=$? # For debugging, ls -l . sub sub/dir $FGREP '.y' $c_outputs + test $st -eq 0 || Exit $st # Adjusted "#line" should not contain reference to the builddir. $EGREP '#.*line.*(build|\.\.).*\.y' $c_outputs && Exit 1 diff --git a/tests/yacc-mix-c-cxx.test b/tests/yacc-mix-c-cxx.test index 4765b5c..bc49380 100755 --- a/tests/yacc-mix-c-cxx.test +++ b/tests/yacc-mix-c-cxx.test @@ -171,10 +171,17 @@ for try in 0 1; do Exit 99 fi + do_make () + { + st=0 + $run_make $* || st=$? + $debug_info + test $st -eq 0 || Exit $? + } + $srcdir/configure - $run_make - $debug_info + do_make test -f p.c test -f p.h @@ -192,13 +199,11 @@ for try in 0 1; do # Minimal checks about recovering from header removal. rm -f p.h parse.hh parse3.hxx - $run_make p.h parse.hh - $debug_info + do_make p.h parse.hh test -f p.h test -f parse.hh test ! -r parse3.hxx - $run_make - $debug_info + do_make test -f parse3.hxx cd $srcdir diff --git a/tests/yacc-pr204.test b/tests/yacc-pr204.test index a1c3691..1d62019 100755 --- a/tests/yacc-pr204.test +++ b/tests/yacc-pr204.test @@ -42,6 +42,7 @@ PARSE2 = parse2.y nodist_foo_SOURCES = parse.y $(PARSE2) distdirtest: distdir + ls -l $(distdir) test ! -f $(distdir)/parse.c test ! -f $(distdir)/parse.y test ! -f $(distdir)/parse.h diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test index 3009063..527fc40 100755 --- a/tests/yaccvpath.test +++ b/tests/yaccvpath.test @@ -76,8 +76,8 @@ void yyerror (char *s) {} fubar : 'f' 'o' 'o' 'b' 'a' 'r' {}; END -$MAKE -$MAKE distdir +$MAKE && $MAKE distdir || { ls -l . $distdir; Exit 1; } +ls -l . $distdir $FGREP fubar $distdir/parse.c # Now check to make sure that `make dist' will rebuild the parser. diff --git a/tests/ylwrap-chdir-back-fail.test b/tests/ylwrap-chdir-back-fail.test index 5212880..6a172e3 100755 --- a/tests/ylwrap-chdir-back-fail.test +++ b/tests/ylwrap-chdir-back-fail.test @@ -42,7 +42,7 @@ chmod a+x fake-yacc mkdir foodir cd foodir -$SHELL "$ocwd"/ylwrap --yacc .y "$ocwd"/x.y "$ocwd"/x.c "$ocwd"/fake-yacc \ +$SHELL "$ocwd"/ylwrap --yacc "$ocwd"/x.y "$ocwd"/x.c "$ocwd"/fake-yacc \ 2>"$ocwd"/stderr && { cat "$ocwd"/stderr >&2; Exit 1; } cd "$ocwd" cat stderr >&2 diff --git a/tests/ylwrap-cleanup-fail.test b/tests/ylwrap-cleanup-fail.test index 0727c80..a5b3b94 100755 --- a/tests/ylwrap-cleanup-fail.test +++ b/tests/ylwrap-cleanup-fail.test @@ -34,7 +34,7 @@ END chmod a+x fake-yacc # ylwrap should return a successful exit status ... -$SHELL ylwrap --yacc .y foo.y foo.c ./fake-yacc 2>stderr \ +$SHELL ylwrap --yacc foo.y foo.c ./fake-yacc 2>stderr \ || { cat stderr >&2; Exit 1; } cat stderr >&2 # ... but also give warnings ... diff --git a/tests/ylwrap-extra-args.test b/tests/ylwrap-extra-args.test index 465de64..d1859af 100755 --- a/tests/ylwrap-extra-args.test +++ b/tests/ylwrap-extra-args.test @@ -38,7 +38,7 @@ manyargs='0 1 2 3 4 5 6 7 8 9 @ : foo bar zardoz asd-asd-asd-asd-asd-asd' mkdir yacc cd yacc -$SHELL -x ../ylwrap --yacc .y foo.y foo.c fake-yacc GrepMe +$SHELL -x ../ylwrap --yacc foo.y foo.c fake-yacc GrepMe cat foo.c $FGREP " GrepMe " foo.c cd .. diff --git a/tests/ylwrap-fail.test b/tests/ylwrap-fail.test index b328153..dc6c5df 100755 --- a/tests/ylwrap-fail.test +++ b/tests/ylwrap-fail.test @@ -46,7 +46,7 @@ PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH mkdir foo cd foo -$SHELL ../ylwrap --yacc .y foo.y foo.c -- fail.sh >../stdout 2>../stderr \ +$SHELL ../ylwrap --yacc foo.y foo.c -- fail.sh >../stdout 2>../stderr \ && { cat ../stdout; cat ../stderr >&2; Exit 1; } cat ../stdout cat ../stderr >&2 @@ -69,7 +69,7 @@ cd .. mkdir baz cd baz -if $SHELL -x ../ylwrap --yacc .yxx foo.yxx foo.cxx -- _NoSuchCommand_; then +if $SHELL -x ../ylwrap --yacc foo.yxx foo.cxx -- _NoSuchCommand_; then Exit 1 else # If ylwrap fails to found the given program, it must exit with 127. @@ -83,7 +83,7 @@ cd .. mkdir dummy1 cd dummy1 -$SHELL ../ylwrap --yacc .y foo.y foo.c -- true 2>../stderr \ +$SHELL ../ylwrap --yacc foo.y foo.c -- true 2>../stderr \ && { cat ../stderr >&2; Exit 1; } cat ../stderr >&2 grep "^ylwrap: expected file \`y\.tab\.c' not found" ../stderr diff --git a/tests/ylwrap-output-rename.test b/tests/ylwrap-output-rename.test index 3b75499..f391dbe 100755 --- a/tests/ylwrap-output-rename.test +++ b/tests/ylwrap-output-rename.test @@ -40,7 +40,7 @@ PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH mkdir yacc cd yacc -$SHELL -x ../ylwrap --yacc .y foo.y zardoz.c fake-yacc +$SHELL -x ../ylwrap --yacc foo.y zardoz.c fake-yacc ls -l test -f zardoz.c test ! -f zardoz.h @@ -51,7 +51,7 @@ cd .. mkdir yacc-d-subdir cd yacc-d-subdir mkdir quux -$SHELL -x ../ylwrap --yacc .y foo.y quux/zardoz.c fake-yacc -d +$SHELL -x ../ylwrap --yacc foo.y quux/zardoz.c fake-yacc -d ls -l . quux test -f quux/zardoz.c test -f quux/zardoz.h @@ -69,7 +69,7 @@ cd .. mkdir yacc-cxx cd yacc-cxx -$SHELL -x ../ylwrap --yacc .yxx foo.yxx f-o--o-.cxx fake-yacc +$SHELL -x ../ylwrap --yacc foo.y++ f-o--o-.cxx fake-yacc ls -l test -f f-o--o-.cxx test ! -f foo.c @@ -79,7 +79,7 @@ cd .. mkdir yacc-cxx-d cd yacc-cxx-d -$SHELL -x ../ylwrap --yacc .y++ foo.y++ .quux..c++ fake-yacc -d +$SHELL -x ../ylwrap --yacc bar .quux..c++ fake-yacc -d ls -l test -f .quux..c++ test -f .quux..h++ @@ -93,7 +93,7 @@ cd .. mkdir yacc-cxx-d-v cd yacc-cxx-d-v -$SHELL -x ../ylwrap --yacc .yy foo.yy y.tab.cc fake-yacc -d -v +$SHELL -x ../ylwrap --yacc foo.yy y.tab.cc fake-yacc -d -v ls -l test -f y.tab.cc test -f y.tab.hh diff --git a/tests/ylwrap-path-handling.test b/tests/ylwrap-path-handling.test index 47fd193..b2fe32a 100755 --- a/tests/ylwrap-path-handling.test +++ b/tests/ylwrap-path-handling.test @@ -40,7 +40,7 @@ ocwd=`pwd` || Exit 99 mkdir 1 cd 1 echo 'blah 1' > foo.y -$SHELL -x ../ylwrap --yacc .y "$ocwd"/1/foo.y ../1/foo.c ../fake-yacc +$SHELL -x ../ylwrap --yacc "$ocwd"/1/foo.y ../1/foo.c ../fake-yacc ls -l cmp foo.y foo.c cmp foo.y foo.h @@ -51,7 +51,7 @@ mkdir 2 cd 2 echo 'blah 2' > foo.yy cp ../fake-yacc . -$SHELL -x ../ylwrap --yacc .yy ./foo.yy "$ocwd"/2/foo.cc -- ./fake-yacc +$SHELL -x ../ylwrap --yacc ./foo.yy "$ocwd"/2/foo.cc -- ./fake-yacc ls -l cmp foo.yy foo.cc cmp foo.yy foo.hh @@ -63,7 +63,7 @@ cd 3 mkdir sub1 sub2 echo 'blah 3' > sub1/foo.yxx cp ../fake-yacc . -$SHELL -x ../ylwrap --yacc .yxx sub1/foo.yxx sub2/foo.cxx -- ../3/fake-yacc +$SHELL -x ../ylwrap --yacc sub1/foo.yxx sub2/foo.cxx -- ../3/fake-yacc ls -l cmp sub1/foo.yxx sub2/foo.cxx cmp sub1/foo.yxx sub2/foo.hxx diff --git a/tests/ylwrap-pwd-fail.test b/tests/ylwrap-pwd-fail.test index 9c45981..d31d97b 100755 --- a/tests/ylwrap-pwd-fail.test +++ b/tests/ylwrap-pwd-fail.test @@ -32,7 +32,7 @@ if (cd .. && rmdir disappear && test ! -d disappear); then if $SHELL -c 'pwd'; then skip_ "pwd suceeds in non-existing directory" else - $SHELL "$ocwd"/ylwrap --yacc .y "$ocwd"/foo.y "$ocwd"/foo.c ':' \ + $SHELL "$ocwd"/ylwrap --yacc "$ocwd"/foo.y "$ocwd"/foo.c ':' \ 2>"$ocwd"/stderr && { cat "$ocwd"/stderr >&2; Exit 1; } cat "$ocwd"/stderr >&2 cd "$ocwd" diff --git a/tests/ylwrap-signals.test b/tests/ylwrap-signals.test index 5bc158e..3b35f81 100755 --- a/tests/ylwrap-signals.test +++ b/tests/ylwrap-signals.test @@ -60,9 +60,9 @@ cd work # The only signals which are portably trappable are 1 (SIGHUP), # 2 (SIGINT), 13 (SIGPIPE) and 15 (SIGTERM). -do_check 1 --yacc .y foo.y foo.c -do_check 2 --lex .l foo.l foo.c -do_check 13 --yacc .yy foo.yy foo.cc -do_check 15 --yacc lex.yy.c foo.l++ foo.c++ +do_check 1 --yacc foo.y foo.c +do_check 2 --lex lex.yy.c foo.l foo.c +do_check 13 --yacc foo.yy foo.cc +do_check 15 --lex lex.yy.c foo.l++ foo.c++ : diff --git a/tests/ylwrap-usage-fail.test b/tests/ylwrap-usage-fail.test index c863a23..0740bf7 100755 --- a/tests/ylwrap-usage-fail.test +++ b/tests/ylwrap-usage-fail.test @@ -41,17 +41,17 @@ done $SHELL ./ylwrap --yacc 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 -grep 'ylwrap:.*missing yacc extension' stderr +grep 'ylwrap:.*missing input file' stderr grep 'Try.*ylwrap --help' stderr -$SHELL ./ylwrap --lex 2>stderr && { cat stderr >&2; Exit 1; } +$SHELL ./ylwrap --yacc foo.y 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 -grep 'ylwrap:.*missing lex output root' stderr +grep 'ylwrap:.*missing output file' stderr grep 'Try.*ylwrap --help' stderr -$SHELL ./ylwrap --yacc .y 2>stderr && { cat stderr >&2; Exit 1; } +$SHELL ./ylwrap --lex 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 -grep 'ylwrap:.*missing input file' stderr +grep 'ylwrap:.*missing lex output root' stderr grep 'Try.*ylwrap --help' stderr $SHELL ./ylwrap 2>stderr --lex foo.yy && { cat stderr >&2; Exit 1; } @@ -64,7 +64,7 @@ cat stderr >&2 grep 'ylwrap:.*missing output file' stderr grep 'Try.*ylwrap --help' stderr -for preamble in '--yacc .y foo.y foo.c' '--lex lex.yy bar.l bar.c'; do +for preamble in '--yacc foo.y foo.c' '--lex lex.yy bar.l bar.c'; do for separator in '' '--'; do $SHELL ./ylwrap $preamble $separator 2>stderr \ && { cat stderr >&2; Exit 1; } diff --git a/tests/ylwrap-yacc-dos.test b/tests/ylwrap-yacc-dos.test index b065758..c850b2f 100755 --- a/tests/ylwrap-yacc-dos.test +++ b/tests/ylwrap-yacc-dos.test @@ -38,7 +38,7 @@ for opts in '' d v vd; do dir=foo${opts}.dir mkdir $dir cd $dir - $SHELL -x ../ylwrap --yacc .y bar.y bar.c dos-yacc -$opts + $SHELL -x ../ylwrap --yacc bar.y bar.c dos-yacc -$opts ls -l # For debugging. ls y[._]* && Exit 1 cat bar.c diff --git a/tests/ylwrap-yacc-ext.test b/tests/ylwrap-yacc-ext.test index 0c81968..a14676d 100755 --- a/tests/ylwrap-yacc-ext.test +++ b/tests/ylwrap-yacc-ext.test @@ -41,12 +41,14 @@ for mold in _ __ _++ _xx _pp; do y=`echo $mold | sed 's/_/y/g'` c=`echo $mold | sed 's/_/c/g'` h=`echo $mold | sed 's/_/h/g'` - $SHELL -x ../ylwrap --yacc .$y x.$y x.$c fake-yacc -$opts - ls -l # For debugging. - ls y.* && Exit 1 - test -f x.$c - case $opts in *d*) test -f x.$h;; *) :;; esac - case $opts in *v*) test -f x.output;; *) :;; esac + for infile in $x.$y $x.y foo; do + $SHELL -x ../ylwrap --yacc $infile x.$c fake-yacc -$opts + ls -l # For debugging. + ls y.* && Exit 1 + test -f x.$c + case $opts in *d*) test -f x.$h;; *) test ! -f x.$h;; esac + case $opts in *v*) test -f x.output;; *) test ! -f x.output;; esac + done cd .. done done diff --git a/tests/ylwrap-yacc-parallel.test b/tests/ylwrap-yacc-parallel.test index fb4c558..cf7663d 100755 --- a/tests/ylwrap-yacc-parallel.test +++ b/tests/ylwrap-yacc-parallel.test @@ -51,7 +51,7 @@ for try in 1 2 3 4; do cd $try for arg in $args; do \ time=`printf %s $arg | wc -c`; export time - $SHELL ../ylwrap --yacc .y $arg.y $arg.c fake-yacc $arg \ + $SHELL ../ylwrap --yacc $arg.y $arg.c fake-yacc $arg \ >stdout.$arg 2>stderr.$arg & unset time done -- 1.7.2.3