Fix --no-self-linked-headers option

This commit is contained in:
Daniel James
2016-08-04 13:36:33 +01:00
parent 6bac96a727
commit 3e2fe6cc2b
5 changed files with 47 additions and 4 deletions

5
test/python/headers.qbk Normal file
View File

@@ -0,0 +1,5 @@
[quickbook 1.6]
[article Headers]
[h1 A]
[heading B]

11
test/python/headers.xml Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<article id="headers" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Headers</title>
<bridgehead renderas="sect1" id="headers.h0">
<phrase id="headers.a"/><link linkend="headers.a">A</link>
</bridgehead>
<bridgehead renderas="sect2" id="headers.h1">
<phrase id="headers.b"/><link linkend="headers.b">B</link>
</bridgehead>
</article>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<article id="headers" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Headers</title>
<bridgehead renderas="sect1" id="headers.a">
A
</bridgehead>
<bridgehead renderas="sect2" id="headers.b">
B
</bridgehead>
</article>

View File

@@ -13,6 +13,9 @@ def main(args, directory):
quickbook_command = args[0]
failures = 0
# Dependency tests
failures += run_quickbook(quickbook_command, 'svg_missing.qbk',
deps_gold = 'svg_missing_deps.txt')
failures += run_quickbook(quickbook_command, 'svg_missing.qbk',
@@ -29,6 +32,14 @@ def main(args, directory):
locations_gold = 'include_glob_locs.txt',
input_path = ['sub1', 'sub2'])
# Headers tests
failures += run_quickbook(quickbook_command, 'headers.qbk',
output_gold = 'headers.xml')
failures += run_quickbook(quickbook_command, 'headers.qbk',
extra_flags = ['--no-self-linked-headers'],
output_gold = 'headers_no_self_linked.xml')
if failures == 0:
print "Success"
else:
@@ -36,7 +47,8 @@ def main(args, directory):
exit(failures)
def run_quickbook(quickbook_command, filename, output_gold = None,
deps_gold = None, locations_gold = None, input_path = []):
deps_gold = None, locations_gold = None, input_path = [],
extra_flags = None):
failures = 0
command = [quickbook_command, '--debug', filename]
@@ -56,9 +68,13 @@ def run_quickbook(quickbook_command, filename, output_gold = None,
locations_filename = temp_filename('.txt')
command.extend(['--output-checked-locations', locations_filename])
for path in input_path:
command.extend(['-I', path])
if extra_flags:
command.extend(extra_flags)
try:
for path in input_path:
command.extend(['-I', path])
print 'Running: ' + ' '.join(command)
print
exit_code = subprocess.call(command)