summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am5
-rw-r--r--tests/REC/Makefile.am75
-rw-r--r--tests/REC/test-2.5-1.err4
-rw-r--r--tests/REC1/Makefile.am7
4 files changed, 72 insertions, 19 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a1589203..8fd4e8b5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -5,6 +5,11 @@ SUBDIRS=docs REC1 REC2 REC general namespaces keys numbers documents \
all:
+# Each subdirectory has it's own Makefile to cater for the unique
+# requirements of that subdirectory. In general, xsltproc will be
+# run on the *.xsl / *.xml file combinations, and the output of that
+# run will be compared with the "expected" output contained in *.out
+# and (if errors are expected) in *.err
test tests:
@(cur=`pwd` ; for dir in $(SUBDIRS) ; do cd $$dir ; $(MAKE) CHECKER='$(CHECKER)' tests ; cd $$cur ; done)
diff --git a/tests/REC/Makefile.am b/tests/REC/Makefile.am
index 120e2acb..bc2c10a7 100644
--- a/tests/REC/Makefile.am
+++ b/tests/REC/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
test-16.1-2.out test-16.1-2.xml test-16.1-2.xsl \
test-2.3-1.out test-2.3-1.xml test-2.3-1.xsl \
test-2.3-2.out test-2.3-2.xml test-2.3-2.xsl \
- test-2.5-1.out test-2.5-1.xml test-2.5-1.xsl \
+ test-2.5-1.out test-2.5-1.xml test-2.5-1.xsl test-2.5-1.err \
test-2.6.2-1.out test-2.6.2-1.xml test-2.6.2-1.xsl \
test-5.2-1.out test-5.2-1.xml test-5.2-1.xsl \
test-5.2-2.out test-5.2-2.xml test-5.2-2.xsl \
@@ -80,25 +80,66 @@ valgrind:
test tests: $(top_builddir)/xsltproc/xsltproc
@(echo > .memdump)
- @(for i in $(srcdir)/*.xsl ; do \
+ @echo '## Running REC tests'
+ -@(for i in $(srcdir)/*.xsl ; do \
name=`basename $$i .xsl` ; \
- if [ ! -f $(srcdir)/$$name.xml ] ; then continue ; fi ; \
- echo $$name.xml ; \
- $(CHECKER) $(top_builddir)/xsltproc/xsltproc $(srcdir)/$$name.xsl $(srcdir)/$$name.xml > $$name.res;\
- if [ ! -f $(srcdir)/$$name.out ] ; then cp $$name.res $(srcdir)/$$name.out ; \
- else if [ ! -s $$name.res ] ; then echo "Fatal error, no $$name.res\n" ; \
- else diff $(srcdir)/$$name.out $$name.res ; fi ; fi; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\
- rm -f $$name.res ; \
+ if [ ! -f $(srcdir)/$$name.xml ] ; then \
+ continue ; \
+ fi ; \
+ log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc \
+ $(srcdir)/$$name.xsl $(srcdir)/$$name.xml \
+ > $$name.res 2>$$name.bad ; \
+ if [ ! -f $(srcdir)/$$name.out ] ; then \
+ cp $$name.res $(srcdir)/$$name.out ; \
+ if [ -s $$name.bad ] ; then \
+ cp $$name.bad $(srcdir)/$$name.err ; \
+ fi ; \
+ else \
+ if [ ! -s $$name.res ] ; then \
+ echo "Fatal error, no $$name.res\n" ; \
+ else \
+ diff $(srcdir)/$$name.out $$name.res ; \
+ if [ -s $$name.err ] ; then \
+ diff $(srcdir)/$$name.err $$name.bad ; \
+ else \
+ diff /dev/null $$name.bad ; \
+ fi ; \
+ fi ; \
+ fi ; \
+ grep "MORY ALLO" .memdump | \
+ grep -v "MEMORY ALLOCATED : 0" || true` ; \
+ if [ -n "$$log" ] ; then \
+ echo $$name result ; \
+ echo $$log ; \
+ fi ; \
+ rm -f $$name.res $$name.bad ; \
done)
@(for i in $(srcdir)/stand*.xml ; do \
name=`basename $$i .xml` ; \
- echo $$name.xml ; \
- $(CHECKER) $(top_builddir)/xsltproc/xsltproc $(srcdir)/$$name.xml > $$name.res;\
- if [ ! -f $(srcdir)/$$name.stand.out ] ; then cp $$name.res $(srcdir)/$$name.stand.out ; \
- else if [ ! -s $$name.res ] ; then echo "Fatal error, no $$name.res\n" ; \
- else diff $(srcdir)/$$name.stand.out $$name.res ; fi ; fi; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\
- rm -f $$name.res ; \
+ log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc \
+ $(srcdir)/$$name.xml > $$name.res 2>$$name.bad ;\
+ if [ ! -f $(srcdir)/$$name.stand.out ] ; then \
+ cp $$name.res $(srcdir)/$$name.stand.out ; \
+ if [ -s $$name.bad ] ; then \
+ cp $$name.bad $(srcdir)/$$name.stand.err ; \
+ fi ; \
+ else \
+ if [ ! -s $$name.res ] ; then \
+ echo "Fatal error, no $$name.res\n" ; \
+ else \
+ diff $(srcdir)/$$name.stand.out $$name.res ; \
+ if [ -s $$name.stand.err ] ; then \
+ diff $(srcdir)/$$name.stand.err $$name.bad ; \
+ else \
+ diff /dev/null $$name.bad; \
+ fi ; \
+ fi ; \
+ fi ; \
+ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true` ; \
+ if [ -n "$$log" ] ; then \
+ echo $$name result ; \
+ echo $$log ; \
+ fi ; \
+ rm -f $$name.res $$name.bad ; \
done)
diff --git a/tests/REC/test-2.5-1.err b/tests/REC/test-2.5-1.err
new file mode 100644
index 00000000..7fbacdd7
--- /dev/null
+++ b/tests/REC/test-2.5-1.err
@@ -0,0 +1,4 @@
+compilation error: file ./test-2.5-1.xsl line 6 element exciting-new-1.8-feature
+xsltStylePreCompute: unknown xsl:exciting-new-1.8-feature
+compilation error: file ./test-2.5-1.xsl line 2 element stylesheet
+xsl:version: only 1.0 features are supported
diff --git a/tests/REC1/Makefile.am b/tests/REC1/Makefile.am
index 510d357a..3b00f0be 100644
--- a/tests/REC1/Makefile.am
+++ b/tests/REC1/Makefile.am
@@ -11,10 +11,13 @@ valgrind:
@echo '## Running the regression tests under Valgrind'
$(MAKE) CHECKER='valgrind -q' tests
+# No special stuff here, just a single test that either works or doesn't!
test tests: $(top_builddir)/xsltproc/xsltproc
+ @echo '## Running REC1 tests'
@(echo > .memdump)
- @($(CHECKER) $(top_builddir)/xsltproc/xsltproc $(srcdir)/doc.xsl $(srcdir)/doc.xml > doc.res ; \
+ @($(CHECKER) $(top_builddir)/xsltproc/xsltproc \
+ $(srcdir)/doc.xsl $(srcdir)/doc.xml > doc.res ; \
diff $(srcdir)/result.xml doc.res ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\
+ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true; \
rm -f doc.res)