summaryrefslogtreecommitdiffstats
path: root/test/Docbook/dependencies
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2013-05-03 23:17:54 (GMT)
committerDirk Baechle <dl9obn@darc.de>2013-05-03 23:17:54 (GMT)
commit2fbab041df44f30a342fc7c0b43bb0808638c7e0 (patch)
treed0af9a1d5bab726ac6f3a402b2bd715f36fb969c /test/Docbook/dependencies
parent0947775a51fa7bdb446b40c08f417fe6ce1ebbdc (diff)
downloadSCons-2fbab041df44f30a342fc7c0b43bb0808638c7e0.zip
SCons-2fbab041df44f30a342fc7c0b43bb0808638c7e0.tar.gz
SCons-2fbab041df44f30a342fc7c0b43bb0808638c7e0.tar.bz2
- added documentation and tests for the new Docbook tool
Diffstat (limited to 'test/Docbook/dependencies')
-rw-r--r--test/Docbook/dependencies/xinclude/image/SConstruct3
-rw-r--r--test/Docbook/dependencies/xinclude/image/include.txt1
-rw-r--r--test/Docbook/dependencies/xinclude/image/manual.xml45
-rw-r--r--test/Docbook/dependencies/xinclude/xinclude.py65
4 files changed, 114 insertions, 0 deletions
diff --git a/test/Docbook/dependencies/xinclude/image/SConstruct b/test/Docbook/dependencies/xinclude/image/SConstruct
new file mode 100644
index 0000000..91d92e6
--- /dev/null
+++ b/test/Docbook/dependencies/xinclude/image/SConstruct
@@ -0,0 +1,3 @@
+env = Environment(tools=['docbook'])
+env.DocbookXInclude('manual_xi.xml','manual.xml')
+
diff --git a/test/Docbook/dependencies/xinclude/image/include.txt b/test/Docbook/dependencies/xinclude/image/include.txt
new file mode 100644
index 0000000..095a94b
--- /dev/null
+++ b/test/Docbook/dependencies/xinclude/image/include.txt
@@ -0,0 +1 @@
+This is an included text.
diff --git a/test/Docbook/dependencies/xinclude/image/manual.xml b/test/Docbook/dependencies/xinclude/image/manual.xml
new file mode 100644
index 0000000..520d309
--- /dev/null
+++ b/test/Docbook/dependencies/xinclude/image/manual.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2001-2010 The SCons Foundation
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-->
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<article xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>The SCons qt4 tool</title>
+
+ <articleinfo>
+ <author>
+ <surname>Dirk Baechle</surname>
+ </author>
+
+ <pubdate>2010-12-06</pubdate>
+ </articleinfo>
+
+ <section id="basics">
+ <title>Basics</title>
+
+ <para><xi:include href="include.txt" parse="text"><xi:fallback>include.txt not found.</xi:fallback></xi:include></para>
+ </section>
+
+</article>
diff --git a/test/Docbook/dependencies/xinclude/xinclude.py b/test/Docbook/dependencies/xinclude/xinclude.py
new file mode 100644
index 0000000..84d9ce7
--- /dev/null
+++ b/test/Docbook/dependencies/xinclude/xinclude.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001-2010 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+"""
+Test implicit dependencies for the XInclude builder.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+try:
+ import libxml2
+except:
+ try:
+ import lxml
+ except:
+ test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n')
+
+test.dir_fixture('image')
+
+# Normal invocation
+test.run()
+test.must_exist(test.workpath('manual_xi.xml'))
+test.must_contain(test.workpath('manual_xi.xml'),'<para>This is an included text.')
+
+# Change included file
+test.write('include.txt', 'This is another text.')
+
+# This should trigger a rebuild
+test.not_up_to_date(options='-n', arguments='.')
+
+# The new file should contain the changes
+test.run()
+test.must_exist(test.workpath('manual_xi.xml'))
+test.must_contain(test.workpath('manual_xi.xml'),'<para>This is another text.')
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: