mirror of
https://github.com/boostorg/quickbook.git
synced 2026-02-09 11:22:21 +00:00
Fix --no-self-linked-headers option
This commit is contained in:
5
test/python/headers.qbk
Normal file
5
test/python/headers.qbk
Normal file
@@ -0,0 +1,5 @@
|
||||
[quickbook 1.6]
|
||||
[article Headers]
|
||||
|
||||
[h1 A]
|
||||
[heading B]
|
||||
11
test/python/headers.xml
Normal file
11
test/python/headers.xml
Normal 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>
|
||||
11
test/python/headers_no_self_linked.xml
Normal file
11
test/python/headers_no_self_linked.xml
Normal 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>
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user