mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merged revisions 65498-65499,65526 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x ........ r65498 | georg.brandl | 2008-08-04 17:07:33 +0000 (Mon, 04 Aug 2008) | 2 lines Absolutize doctreedir when parsing from commandline. ........ r65499 | georg.brandl | 2008-08-04 17:17:49 +0000 (Mon, 04 Aug 2008) | 4 lines If output and/or doctree directory are within the source directory, except them from the search for source files. ........ r65526 | georg.brandl | 2008-08-04 21:46:41 +0000 (Mon, 04 Aug 2008) | 2 lines Let the test suite run the text, linkcheck, and changes builders. ........
This commit is contained in:
@@ -58,6 +58,7 @@ today_fmt = '%B %d, %Y'
|
||||
# List of directories, relative to source directories, that shouldn't be searched
|
||||
# for source files.
|
||||
#exclude_dirs = []
|
||||
exclude_trees = ['_build']
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
"""
|
||||
|
||||
import os
|
||||
import difflib
|
||||
import htmlentitydefs
|
||||
from StringIO import StringIO
|
||||
from etree13 import ElementTree as ET
|
||||
|
||||
from util import *
|
||||
from etree13 import ElementTree as ET
|
||||
|
||||
from sphinx.builder import StandaloneHTMLBuilder, LaTeXBuilder
|
||||
|
||||
@@ -66,14 +67,17 @@ class NslessParser(ET.XMLParser):
|
||||
def test_html(app):
|
||||
app.builder.build_all()
|
||||
html_warnings = html_warnfile.getvalue().replace(os.sep, '/')
|
||||
assert html_warnings == HTML_WARNINGS % {'root': app.srcdir}
|
||||
html_warnings_exp = HTML_WARNINGS % {'root': app.srcdir}
|
||||
assert html_warnings == html_warnings_exp, 'Warnings don\'t match:\n' + \
|
||||
'\n'.join(difflib.ndiff(html_warnings_exp.splitlines(),
|
||||
html_warnings.splitlines()))
|
||||
|
||||
if not ET:
|
||||
return
|
||||
for fname, paths in HTML_XPATH.iteritems():
|
||||
parser = NslessParser()
|
||||
parser.entity.update(htmlentitydefs.entitydefs)
|
||||
etree = ET.parse(app.outdir / fname, parser)
|
||||
etree = ET.parse(os.path.join(app.outdir, fname), parser)
|
||||
for path, text in paths.iteritems():
|
||||
nodes = list(etree.findall(path))
|
||||
assert nodes != []
|
||||
@@ -92,4 +96,22 @@ def test_html(app):
|
||||
def test_latex(app):
|
||||
app.builder.build_all()
|
||||
latex_warnings = latex_warnfile.getvalue().replace(os.sep, '/')
|
||||
assert latex_warnings == LATEX_WARNINGS % {'root': app.srcdir}
|
||||
latex_warnings_exp = LATEX_WARNINGS % {'root': app.srcdir}
|
||||
assert latex_warnings == latex_warnings_exp, 'Warnings don\'t match:\n' + \
|
||||
'\n'.join(difflib.ndiff(latex_warnings_exp.splitlines(),
|
||||
latex_warnings.splitlines()))
|
||||
|
||||
|
||||
# just let the remaining ones run for now
|
||||
|
||||
@with_testapp(buildername='linkcheck')
|
||||
def test_linkcheck(app):
|
||||
app.builder.build_all()
|
||||
|
||||
@with_testapp(buildername='text')
|
||||
def test_text(app):
|
||||
app.builder.build_all()
|
||||
|
||||
@with_testapp(buildername='changes')
|
||||
def test_changes(app):
|
||||
app.builder.build_all()
|
||||
|
||||
@@ -135,10 +135,10 @@ class TestApp(application.Sphinx):
|
||||
|
||||
def cleanup(self):
|
||||
trees = [self.outdir, self.doctreedir]
|
||||
#f self.made_builddir:
|
||||
# trees.append(self.builddir)
|
||||
#for tree in trees:
|
||||
# shutil.rmtree(tree, True)
|
||||
if self.made_builddir:
|
||||
trees.append(self.builddir)
|
||||
for tree in trees:
|
||||
shutil.rmtree(tree, True)
|
||||
|
||||
|
||||
def with_testapp(*args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user