]> git.saurik.com Git - bison.git/commitdiff
tests: save/restore Autotest special files when checking XML support.
authorAkim Demaille <akim@lrde.epita.fr>
Fri, 11 May 2012 15:11:09 +0000 (17:11 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Fri, 11 May 2012 15:13:48 +0000 (17:13 +0200)
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
tests/regression.at

index ee451ad553bbb78bb129270927acf517a251fd38..65e528f98637e48f2713826c4e8320324036d51b 100644 (file)
@@ -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],
 # 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)?=[^][ ]*], [],
   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])
   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
 # -----------------
 
 # AT_QUELL_VALGRIND
 # -----------------
index 584c541b4d796815a58070dfae3de700cdcaeb51..f5603eae9f49bef6b10d5c97dc5bd288dd5c5734 100644 (file)
@@ -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]])
 # 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_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
 
 
 AT_CLEANUP