summaryrefslogtreecommitdiffstats
path: root/test/Docbook/rootname
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2020-06-24 15:18:02 (GMT)
committerDirk Baechle <dl9obn@darc.de>2020-06-24 21:10:57 (GMT)
commit74089e4ac2d1a2f96ec922b0f6f5bf59956a3ca9 (patch)
tree0b2e89fddd7440b0cbe48b18798d8aab4c7cb111 /test/Docbook/rootname
parentea848745d7025d8f6885dfbeaaa92731ddd711bd (diff)
downloadSCons-74089e4ac2d1a2f96ec922b0f6f5bf59956a3ca9.zip
SCons-74089e4ac2d1a2f96ec922b0f6f5bf59956a3ca9.tar.gz
SCons-74089e4ac2d1a2f96ec922b0f6f5bf59956a3ca9.tar.bz2
Fix for failing Docbook slides tests.
Diffstat (limited to 'test/Docbook/rootname')
-rw-r--r--test/Docbook/rootname/slideshtml/image/.exclude_tests1
-rw-r--r--test/Docbook/rootname/slideshtml/image/SConstruct11
-rw-r--r--test/Docbook/rootname/slideshtml/image/slides.xsl18
-rw-r--r--test/Docbook/rootname/slideshtml/image/virtns.xml33
-rw-r--r--test/Docbook/rootname/slideshtml/image/xsltver.py20
-rw-r--r--test/Docbook/rootname/slideshtml/slideshtml.py7
6 files changed, 66 insertions, 24 deletions
diff --git a/test/Docbook/rootname/slideshtml/image/.exclude_tests b/test/Docbook/rootname/slideshtml/image/.exclude_tests
new file mode 100644
index 0000000..966db3c
--- /dev/null
+++ b/test/Docbook/rootname/slideshtml/image/.exclude_tests
@@ -0,0 +1 @@
+xsltver.py \ No newline at end of file
diff --git a/test/Docbook/rootname/slideshtml/image/SConstruct b/test/Docbook/rootname/slideshtml/image/SConstruct
index 769314c..4f1079e 100644
--- a/test/Docbook/rootname/slideshtml/image/SConstruct
+++ b/test/Docbook/rootname/slideshtml/image/SConstruct
@@ -1,3 +1,12 @@
+import xsltver
+
+v = xsltver.detectXsltVersion('/usr/share/xml/docbook/stylesheet/docbook-xsl')
+
+ns_ext = ''
+if v >= (1, 78, 0):
+ # Use namespace-aware input file
+ ns_ext = 'ns'
+
env = Environment(tools=['docbook'])
-env.DocbookSlidesHtml('manual.html', 'virt', xsl='slides.xsl')
+env.DocbookSlidesHtml('manual.html', 'virt'+ns_ext, xsl='slides.xsl')
diff --git a/test/Docbook/rootname/slideshtml/image/slides.xsl b/test/Docbook/rootname/slideshtml/image/slides.xsl
index 29058f1..a490b0a 100644
--- a/test/Docbook/rootname/slideshtml/image/slides.xsl
+++ b/test/Docbook/rootname/slideshtml/image/slides.xsl
@@ -26,6 +26,7 @@
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:dbs="http://docbook.org/ns/docbook-slides"
version="1.0">
<xsl:import href="file:///usr/share/xml/docbook/stylesheet/docbook-xsl/slides/xhtml/plain.xsl"/>
@@ -34,22 +35,5 @@
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="titlefoil.html" select="'manual.html'"/>
<xsl:param name="html.stylesheet" select="'scons.css'"/>
-<xsl:param name="generate.toc">
-/appendix toc,title
-article/appendix nop
-/article toc,title
-book toc,title,figure,table,example,equation
-/chapter toc,title
-part toc,title
-/preface toc,title
-reference toc,title
-/sect1 toc
-/sect2 toc
-/sect3 toc
-/sect4 toc
-/sect5 toc
-/section toc
-set toc,title
-</xsl:param>
</xsl:stylesheet>
diff --git a/test/Docbook/rootname/slideshtml/image/virtns.xml b/test/Docbook/rootname/slideshtml/image/virtns.xml
new file mode 100644
index 0000000..f64c624
--- /dev/null
+++ b/test/Docbook/rootname/slideshtml/image/virtns.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dbs:slides xmlns="http://docbook.org/ns/docbook"
+ xmlns:dbs="http://docbook.org/ns/docbook-slides"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <info>
+ <title>Virtuelles Kopieren</title>
+
+ <titleabbrev>Virtuelles Kopieren</titleabbrev>
+
+ <copyright>
+ <year>2007</year>
+
+ <holder>Femutec GmbH</holder>
+ </copyright>
+
+ <author>
+ <firstname>Dirk</firstname>
+
+ <surname>Baechle</surname>
+ </author>
+
+ <pubdate>09.07.2007</pubdate>
+ </info>
+
+<dbs:foilgroup>
+<title>Group</title>
+ <dbs:foil>
+ <title>sfForming</title>
+
+ </dbs:foil>
+</dbs:foilgroup>
+</dbs:slides>
+
diff --git a/test/Docbook/rootname/slideshtml/image/xsltver.py b/test/Docbook/rootname/slideshtml/image/xsltver.py
new file mode 100644
index 0000000..c845324
--- /dev/null
+++ b/test/Docbook/rootname/slideshtml/image/xsltver.py
@@ -0,0 +1,20 @@
+import os
+import re
+
+def detectXsltVersion(fpath):
+ """ Return a tuple with the version of the Docbook XSLT stylesheets,
+ or (0, 0, 0) if no stylesheets are installed or the VERSION
+ file couldn't be found/parsed correctly.
+ """
+ with open(os.path.join(fpath, 'VERSION'), 'rb') as fin:
+ re_version = re.compile("<fm:Version>([^<]+)</fm:Version>".encode('utf-8'))
+ m = re_version.search(fin.read())
+ if m:
+ try:
+ return tuple(map(int, m.group(1).split(b'.')))
+ except Exception:
+ return (0, 0, 0)
+
+ return (0, 0, 0)
+
+ return (0, 0, 0)
diff --git a/test/Docbook/rootname/slideshtml/slideshtml.py b/test/Docbook/rootname/slideshtml/slideshtml.py
index 2d8500e..daa5d8d 100644
--- a/test/Docbook/rootname/slideshtml/slideshtml.py
+++ b/test/Docbook/rootname/slideshtml/slideshtml.py
@@ -46,16 +46,11 @@ test.dir_fixture('image')
# Normal invocation
test.run(stderr=None)
test.must_not_be_empty(test.workpath('manual.html'))
-test.must_not_be_empty(test.workpath('toc.html'))
-test.must_not_be_empty(test.workpath('foil01.html'))
-test.must_not_be_empty(test.workpath('foilgroup01.html'))
+test.must_contain(test.workpath('manual.html'), 'sfForming')
# Cleanup
test.run(arguments='-c')
test.must_not_exist(test.workpath('manual.html'))
-test.must_not_exist(test.workpath('toc.html'))
-test.must_not_exist(test.workpath('foil01.html'))
-test.must_not_exist(test.workpath('foilgroup01.html'))
test.pass_test()