From: Akim Demaille Date: Fri, 11 May 2012 15:11:09 +0000 (+0200) Subject: tests: save/restore Autotest special files when checking XML support. X-Git-Tag: v2.5.1_rc2~12 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/035810ed2ef420450f3085ff5596f0ab0c33c850 tests: save/restore Autotest special files when checking XML support. Currently the test 248, "parse-gram.y: LALR = IELR", fails BISON_TEST_XML is set. * tests/local.at (AT_BISON_CHECK_XML): Belt: Save/restore files. * tests/regression.at (parse-gram.y: LALR = IELR): Suspenders: Don't rely on expout. Each one of these changes suffices. --- diff --git a/tests/local.at b/tests/local.at index ee451ad5..65e528f9 100644 --- a/tests/local.at +++ b/tests/local.at @@ -373,8 +373,9 @@ m4_if(m4_bregexp([$4], [: warning: ]), [-1], [], # defined. It doesn't make sense to invoke this macro if Bison is expected to # have a non-zero exit status. m4_define([AT_BISON_CHECK_XML], -[[if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then - mkdir xml-tests] +[[if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then] + AT_SAVE_SPECIAL_FILES + [mkdir xml-tests] m4_pushdef([AT_BISON_ARGS], [m4_bpatsubsts([[$1]], [--report(-file)?=[^][ ]*], [], @@ -396,8 +397,9 @@ m4_define([AT_BISON_CHECK_XML], AT_CHECK([[$XSLTPROC \ `]]AT_QUELL_VALGRIND[[ bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml]], [[0]], [expout]) - [rm -rf xml-tests expout -fi]]) + [rm -rf xml-tests expout] + AT_RESTORE_SPECIAL_FILES +[fi]]) # AT_QUELL_VALGRIND # ----------------- diff --git a/tests/regression.at b/tests/regression.at index 584c541b..f5603eae 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -1266,10 +1266,12 @@ AT_SETUP([[parse-gram.y: LALR = IELR]]) # have the same name. [cp $abs_top_srcdir/src/parse-gram.y input.y] AT_BISON_CHECK([[-o input.c -Dlr.type=lalr input.y]]) -[mv input.c expout] +[mv input.c lalr.c] +AT_CAPTURE_FILE([lalr.c]) AT_BISON_CHECK([[-o input.c -Dlr.type=ielr input.y]]) [mv input.c ielr.c] -AT_CHECK([[cat ielr.c]], [[0]], [[expout]]) +AT_CAPTURE_FILE([ielr.c]) +AT_CHECK([[diff lalr.c ielr.c]], [[0]]) AT_CLEANUP