From 035810ed2ef420450f3085ff5596f0ab0c33c850 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 11 May 2012 17:11:09 +0200 Subject: [PATCH] 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. --- tests/local.at | 10 ++++++---- tests/regression.at | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) 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 -- 2.45.2