diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2016-11-17 21:21:33 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2016-11-17 21:21:33 (GMT) |
commit | 8705a471f0cb989dca5bed1ac1aa9c982146ceb0 (patch) | |
tree | c76eb1b28847599af70596ce7adbfd62ca4985f5 /libxslt/tests/extensions | |
parent | 8d530e150d787e9a74e27592d4e67a496cd922da (diff) | |
parent | 93eaa8f0a22ef3712b9a4bafdc50ba9a7d80ae8f (diff) | |
download | blt-8705a471f0cb989dca5bed1ac1aa9c982146ceb0.zip blt-8705a471f0cb989dca5bed1ac1aa9c982146ceb0.tar.gz blt-8705a471f0cb989dca5bed1ac1aa9c982146ceb0.tar.bz2 |
Merge commit '93eaa8f0a22ef3712b9a4bafdc50ba9a7d80ae8f' as 'libxslt'
Diffstat (limited to 'libxslt/tests/extensions')
-rw-r--r-- | libxslt/tests/extensions/Makefile.am | 51 | ||||
-rw-r--r-- | libxslt/tests/extensions/evaluate.out | 2 | ||||
-rw-r--r-- | libxslt/tests/extensions/evaluate.xml | 11 | ||||
-rw-r--r-- | libxslt/tests/extensions/evaluate.xsl | 26 | ||||
-rw-r--r-- | libxslt/tests/extensions/list.out | 40 | ||||
-rw-r--r-- | libxslt/tests/extensions/list.xml | 1 | ||||
-rw-r--r-- | libxslt/tests/extensions/list.xsl | 88 | ||||
-rw-r--r-- | libxslt/tests/extensions/module.out | 3 | ||||
-rw-r--r-- | libxslt/tests/extensions/module.xml | 1 | ||||
-rw-r--r-- | libxslt/tests/extensions/module.xsl | 12 |
10 files changed, 235 insertions, 0 deletions
diff --git a/libxslt/tests/extensions/Makefile.am b/libxslt/tests/extensions/Makefile.am new file mode 100644 index 0000000..06ac236 --- /dev/null +++ b/libxslt/tests/extensions/Makefile.am @@ -0,0 +1,51 @@ +## Process this file with automake to produce Makefile.in + +$(top_builddir)/xsltproc/xsltproc: + @(cd ../../xsltproc ; $(MAKE) xsltproc) + +EXTRA_DIST = \ + evaluate.xml evaluate.xsl evaluate.out \ + module.xml module.xsl module.out \ + list.xml list.xsl list.out + +CLEANFILES = .memdump + +valgrind: + @echo '## Running the regression tests under Valgrind' + $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests + +test tests: $(top_builddir)/xsltproc/xsltproc + @echo '## Running extensions tests' + @(echo > .memdump) + -@(for i in $(srcdir)/*.xml ; do \ + if [ -d $$i ] ; then continue ; fi ; \ + doc=`basename $$i .xml` ; \ + j=$(srcdir)/$$doc*.xsl ; \ + if [ ! -f $$j ] ; then continue ; fi ; \ + if [ -d $$j ] ; then continue ; fi ; \ + name=`basename $$j .xsl`; \ + out=$(srcdir)/"$$name".out; \ + err=$(srcdir)/"$$name".err; \ + log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc $$j $$i \ + > result.$$name 2>err.$$name; \ + if [ ! -f $$out ] ; then \ + cp result.$$name $$out ; \ + if [ -s err.$$name ] ; then \ + cp err.$$name $$err ; \ + fi ; \ + else \ + diff $$out result.$$name; \ + if [ -s $$err ] ; then \ + diff $$err err.$$name; \ + else \ + diff /dev/null err.$$name; \ + fi ; \ + fi ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true`;\ + if [ -n "$$log" ] ; then \ + echo $$name result ; \ + echo "$$log" ; \ + fi ; \ + rm -f result.$$name err.$$name; \ + done) + diff --git a/libxslt/tests/extensions/evaluate.out b/libxslt/tests/extensions/evaluate.out new file mode 100644 index 0000000..b4e4c7c --- /dev/null +++ b/libxslt/tests/extensions/evaluate.out @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +one4onetwofour-onefour-two diff --git a/libxslt/tests/extensions/evaluate.xml b/libxslt/tests/extensions/evaluate.xml new file mode 100644 index 0000000..bddd528 --- /dev/null +++ b/libxslt/tests/extensions/evaluate.xml @@ -0,0 +1,11 @@ +<doc> + <one>one</one> + <two>two</two> + <three>/doc/one</three> + <four> + <doc> + <one>four-one</one> + <two>four-two</two> + </doc> + </four> +</doc>
\ No newline at end of file diff --git a/libxslt/tests/extensions/evaluate.xsl b/libxslt/tests/extensions/evaluate.xsl new file mode 100644 index 0000000..c44bfc8 --- /dev/null +++ b/libxslt/tests/extensions/evaluate.xsl @@ -0,0 +1,26 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:saxon="http://icl.com/saxon" + version='1.0'> + +<xsl:variable name="expression" select="saxon:expression('doc/two')"/> + + <xsl:template match="/"> + <xsl:variable name="string">doc/one</xsl:variable> + <xsl:value-of select="saxon:evaluate($string)"/> + <xsl:value-of select="count(saxon:evaluate('/doc/one')/../*)"/> + <xsl:value-of select="saxon:evaluate(/doc/three)"/> + <xsl:value-of select="saxon:eval($expression)"/> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="four"> + <xsl:variable name="string">doc/one</xsl:variable> + <xsl:value-of select="saxon:evaluate($string)"/> + <xsl:value-of select="saxon:eval($expression)"/> + </xsl:template> + + <xsl:template match="text()"/> + +</xsl:stylesheet> diff --git a/libxslt/tests/extensions/list.out b/libxslt/tests/extensions/list.out new file mode 100644 index 0000000..e2d9ce1 --- /dev/null +++ b/libxslt/tests/extensions/list.out @@ -0,0 +1,40 @@ +<?xml version="1.0"?> + === 24 Standard elements: +xsl:apply-templates available +xsl:apply-imports available +xsl:call-template available +xsl:element available +xsl:attribute available +xsl:text available +xsl:processing-instruction available +xsl:comment available +xsl:copy available +xsl:value-of available +xsl:number available +xsl:for-each available +xsl:if available +xsl:choose available +xsl:sort available +xsl:copy-of available +xsl:message available +xsl:variable available +xsl:param available +xsl:with-param available +xsl:decimal-format available +xsl:when available +xsl:otherwise available +xsl:fallback available + === 5 Extension elements: +xsl:element available +saxon:output available +xalanredirect:write available +xt:document available +libxslt:debug available + === 6 Extension functions: +libxslt:node-set() available +saxon:node-set() available +xt:node-set() available +saxon:evaluate() available +saxon:expression() available +saxon:eval() available + diff --git a/libxslt/tests/extensions/list.xml b/libxslt/tests/extensions/list.xml new file mode 100644 index 0000000..ff29a91 --- /dev/null +++ b/libxslt/tests/extensions/list.xml @@ -0,0 +1 @@ +<doc/>
\ No newline at end of file diff --git a/libxslt/tests/extensions/list.xsl b/libxslt/tests/extensions/list.xsl new file mode 100644 index 0000000..0523342 --- /dev/null +++ b/libxslt/tests/extensions/list.xsl @@ -0,0 +1,88 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:saxon="http://icl.com/saxon" + xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect" + xmlns:xt="http://www.jclark.com/xt" + xmlns:libxslt="http://xmlsoft.org/XSLT/namespace" + version='1.0'> + +<xsl:template match="/"> +<xsl:text> === 24 Standard elements: +</xsl:text> +<xsl:if test="element-available('xsl:apply-templates')">xsl:apply-templates available +</xsl:if> +<xsl:if test="element-available('xsl:apply-imports')">xsl:apply-imports available +</xsl:if> +<xsl:if test="element-available('xsl:call-template')">xsl:call-template available +</xsl:if> +<xsl:if test="element-available('xsl:element')">xsl:element available +</xsl:if> +<xsl:if test="element-available('xsl:attribute')">xsl:attribute available +</xsl:if> +<xsl:if test="element-available('xsl:text')">xsl:text available +</xsl:if> +<xsl:if test="element-available('xsl:processing-instruction')">xsl:processing-instruction available +</xsl:if> +<xsl:if test="element-available('xsl:comment')">xsl:comment available +</xsl:if> +<xsl:if test="element-available('xsl:copy')">xsl:copy available +</xsl:if> +<xsl:if test="element-available('xsl:value-of')">xsl:value-of available +</xsl:if> +<xsl:if test="element-available('xsl:number')">xsl:number available +</xsl:if> +<xsl:if test="element-available('xsl:for-each')">xsl:for-each available +</xsl:if> +<xsl:if test="element-available('xsl:if')">xsl:if available +</xsl:if> +<xsl:if test="element-available('xsl:choose')">xsl:choose available +</xsl:if> +<xsl:if test="element-available('xsl:sort')">xsl:sort available +</xsl:if> +<xsl:if test="element-available('xsl:copy-of')">xsl:copy-of available +</xsl:if> +<xsl:if test="element-available('xsl:message')">xsl:message available +</xsl:if> +<xsl:if test="element-available('xsl:variable')">xsl:variable available +</xsl:if> +<xsl:if test="element-available('xsl:param')">xsl:param available +</xsl:if> +<xsl:if test="element-available('xsl:with-param')">xsl:with-param available +</xsl:if> +<xsl:if test="element-available('xsl:decimal-format')">xsl:decimal-format available +</xsl:if> +<xsl:if test="element-available('xsl:when')">xsl:when available +</xsl:if> +<xsl:if test="element-available('xsl:otherwise')">xsl:otherwise available +</xsl:if> +<xsl:if test="element-available('xsl:fallback')">xsl:fallback available +</xsl:if> +<xsl:text> === 5 Extension elements: +</xsl:text> +<xsl:if test="element-available('xsl:element')">xsl:element available +</xsl:if> +<xsl:if test="element-available('saxon:output')">saxon:output available +</xsl:if> +<xsl:if test="element-available('xalanredirect:write')">xalanredirect:write available +</xsl:if> +<xsl:if test="element-available('xt:document')">xt:document available +</xsl:if> +<xsl:if test="element-available('libxslt:debug')">libxslt:debug available +</xsl:if> +<xsl:text> === 6 Extension functions: +</xsl:text> +<xsl:if test="function-available('libxslt:node-set')">libxslt:node-set() available +</xsl:if> +<xsl:if test="function-available('saxon:node-set')">saxon:node-set() available +</xsl:if> +<xsl:if test="function-available('xt:node-set')">xt:node-set() available +</xsl:if> +<xsl:if test="function-available('saxon:evaluate')">saxon:evaluate() available +</xsl:if> +<xsl:if test="function-available('saxon:expression')">saxon:expression() available +</xsl:if> +<xsl:if test="function-available('saxon:eval')">saxon:eval() available +</xsl:if> +</xsl:template> + +</xsl:stylesheet> diff --git a/libxslt/tests/extensions/module.out b/libxslt/tests/extensions/module.out new file mode 100644 index 0000000..fa2cdd7 --- /dev/null +++ b/libxslt/tests/extensions/module.out @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<!--libxslt:test element test worked--> +SUCCESS diff --git a/libxslt/tests/extensions/module.xml b/libxslt/tests/extensions/module.xml new file mode 100644 index 0000000..69d62f2 --- /dev/null +++ b/libxslt/tests/extensions/module.xml @@ -0,0 +1 @@ +<doc/> diff --git a/libxslt/tests/extensions/module.xsl b/libxslt/tests/extensions/module.xsl new file mode 100644 index 0000000..4ada278 --- /dev/null +++ b/libxslt/tests/extensions/module.xsl @@ -0,0 +1,12 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:libxslt="http://xmlsoft.org/XSLT/" + xmlns:test="http://xmlsoft.org/XSLT/" + extension-element-prefixes="libxslt test" + version='1.0'> +<!-- the prefix is registered twice to check single initialization --> +<xsl:template match="/"> +<libxslt:test/> +<xsl:value-of select="libxslt:test('SUCCESS')"/> +</xsl:template> +</xsl:stylesheet> |