Add tests for Texinfo builder

This commit is contained in:
Jonathan Waltman
2010-09-16 02:19:06 -05:00
parent a5343b4c5b
commit 13684aa91f
3 changed files with 67 additions and 0 deletions
+5
View File
@@ -49,6 +49,11 @@ latex_documents = [
latex_additional_files = ['svgimg.svg']
texinfo_documents = [
('contents', 'SphinxTests', 'Sphinx Tests',
'Georg Brandl \\and someone else', 'Sphinx Testing', 'Miscellaneous'),
]
value_from_conf_py = 84
coverage_c_path = ['special/*.h']
+54
View File
@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
"""
test_build_texinfo
~~~~~~~~~~~~~~~~~~
Test the build process with Texinfo builder with the test root.
:copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
from StringIO import StringIO
from subprocess import Popen, PIPE
from sphinx.writers.texinfo import TexinfoTranslator
from util import *
from test_build_html import ENV_WARNINGS
def teardown_module():
(test_root / '_build').rmtree(True)
texinfo_warnfile = StringIO()
if sys.version_info >= (3, 0):
TEXINFO_WARNINGS = remove_unicode_literals(TEXINFO_WARNINGS)
@with_app(buildername='texinfo', warning=texinfo_warnfile, cleanenv=True)
def test_texinfo(app):
app.builder.build_all()
# now, try to run makeinfo over it
cwd = os.getcwd()
os.chdir(app.outdir)
try:
try:
p = Popen(['makeinfo', '--no-split', 'SphinxTests.texi'],
stdout=PIPE, stderr=PIPE)
except OSError:
pass # most likely makeinfo was not found
else:
stdout, stderr = p.communicate()
retcode = p.returncode
if retcode != 0:
print stdout
print stderr
del app.cleanup_trees[:]
assert False, 'makeinfo exited with return code %s' % retcode
finally:
os.chdir(cwd)
+8
View File
@@ -171,6 +171,14 @@ def test_quickstart_all_answers(tempdir):
assert ns['man_pages'] == [
('contents', 'stasi', u'STASI™ Documentation',
[u'Wolfgang Schäuble & G\'Beckstein'], 1)]
print ns['texinfo_documents']
print [('contents', 'STASI', u'STASI™ Documentation',
u'Wolfgang Schäuble & G\'Beckstein', 'STASI',
'One line description of project.', 'Miscellaneous'),]
assert ns['texinfo_documents'] == [
('contents', 'STASI', u'STASI™ Documentation',
u'Wolfgang Schäuble & G\'Beckstein', 'STASI',
'One line description of project.', 'Miscellaneous'),]
assert (tempdir / 'build').isdir()
assert (tempdir / 'source' / '.static').isdir()