diff --git a/src/quickbook.cpp b/src/quickbook.cpp index 3447a46..25f794a 100644 --- a/src/quickbook.cpp +++ b/src/quickbook.cpp @@ -382,7 +382,7 @@ main(int argc, char* argv[]) if (vm.count("no-pretty-print")) parse_document_options.pretty_print = false; - quickbook::self_linked_headers = !vm.count("no-self-link-headers"); + quickbook::self_linked_headers = !vm.count("no-self-linked-headers"); if (vm.count("indent")) parse_document_options.indent = vm["indent"].as(); diff --git a/test/python/headers.qbk b/test/python/headers.qbk new file mode 100644 index 0000000..e9817a3 --- /dev/null +++ b/test/python/headers.qbk @@ -0,0 +1,5 @@ +[quickbook 1.6] +[article Headers] + +[h1 A] +[heading B] diff --git a/test/python/headers.xml b/test/python/headers.xml new file mode 100644 index 0000000..3fb2b0d --- /dev/null +++ b/test/python/headers.xml @@ -0,0 +1,11 @@ + + +
+ Headers + + A + + + B + +
diff --git a/test/python/headers_no_self_linked.xml b/test/python/headers_no_self_linked.xml new file mode 100644 index 0000000..260be27 --- /dev/null +++ b/test/python/headers_no_self_linked.xml @@ -0,0 +1,11 @@ + + +
+ Headers + + A + + + B + +
diff --git a/test/python/output-deps.py b/test/python/run_tests.py similarity index 91% rename from test/python/output-deps.py rename to test/python/run_tests.py index 875a808..14e38d9 100644 --- a/test/python/output-deps.py +++ b/test/python/run_tests.py @@ -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)