bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: Ship and install bison.xsl


From: Joel E. Denny
Subject: Re: FYI: Ship and install bison.xsl
Date: Sun, 18 Nov 2007 02:13:14 -0500 (EST)

On Sat, 17 Nov 2007, Joel E. Denny wrote:

> On Wed, 14 Nov 2007, Akim Demaille wrote:
> 
> > It might be time to write some (simple) tests of the XML output.  If I
> > have some time I will, but...
> 
> We might consider adding a maintainer-xml-check similar to 
> maintainer-push-check.  That is, we might test the XSLT output against the 
> --report and --graph output for all grammars in the test suite.  Of 
> course, this would not help with xml2xhtml.xsl, so it would definitely 
> need its own test cases.
> 
> I'm sure we could come up with something in M4 to make this happen.  
> Unfortunately, the "Big triangle" and "Big horizontal" torture tests never 
> complete on my system when testing xml2dot.xsl, so we would want to be 
> able to specify that certain test cases be skipped.

Using the following patch, here's what I've been doing to test 
xml2text.xsl and xml2dot.xsl:

  BISON_TEST_XML=1 ./testsuite 1-156 159-

M4 seems like a cleaner approach, but maybe we can salvage some of this 
patch.

Index: tests/bison.in
===================================================================
RCS file: /sources/bison/bison/tests/bison.in,v
retrieving revision 1.7
diff -p -u -r1.7 bison.in
--- tests/bison.in      5 Oct 2004 09:58:58 -0000       1.7
+++ tests/bison.in      18 Nov 2007 07:11:00 -0000
@@ -5,4 +5,30 @@
 # Use the shipped files, not those installed.
 BISON_PKGDATADIR='@abs_top_srcdir@/data'
 export BISON_PKGDATADIR
+
+if test x"$BISON_TEST_XML" = x1; then
+  mkdir xml-tests
+  $PREBISON '@abs_top_builddir@/src/bison' \
+    --report=all --report-file=xml-tests/test.output \
+    --graph=xml-tests/test.dot --xml=xml-tests/test.xml \
+    `echo ${1+"$@"} | sed \
+      -e 's/--report\(-file\)\?=[^ ]*//g' \
+      -e 's/--graph=[^ ]*//g' -e 's/--xml=[^ ]*//g' \
+    ` >/dev/null 2>&1
+  # Really shouldn't skip unless test case actually expects a failure.
+  if test $? -eq 0; then
+    # Make sure diff doesn't complain about closed stdout.
+    diff -u xml-tests/test.xml xml-tests/test.xml 2>/dev/null
+    if test $? -eq 0; then
+      xsltproc '@abs_top_builddir@/data/xslt/xml2text.xsl' \
+        xml-tests/test.xml > xml-tests/test.xml-output
+      diff -u xml-tests/test.output xml-tests/test.xml-output
+      xsltproc '@abs_top_builddir@/data/xslt/xml2dot.xsl' \
+        xml-tests/test.xml > xml-tests/test.xml-dot
+      diff -u xml-tests/test.dot xml-tests/test.xml-dot
+    fi
+  fi
+  rm -rf xml-tests
+fi
+
 exec $PREBISON '@abs_top_builddir@/src/bison' ${1+"$@"}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]