diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py index af0e658fcdc55..c82b4479f299d 100755 --- a/clang/docs/tools/dump_format_style.py +++ b/clang/docs/tools/dump_format_style.py @@ -487,5 +487,6 @@ class State: contents = substitute(contents, "FORMAT_STYLE_OPTIONS", options_text) -with open(DOC_FILE, "wb") as output: +output_file_path = sys.argv[1] if len(sys.argv) == 2 else DOC_FILE +with open(output_file_path, "wb") as output: output.write(contents.encode()) diff --git a/clang/test/Format/docs_updated.test b/clang/test/Format/docs_updated.test new file mode 100644 index 0000000000000..fe2e4f1bd13a1 --- /dev/null +++ b/clang/test/Format/docs_updated.test @@ -0,0 +1,2 @@ +// RUN: %python %S/../../docs/tools/dump_format_style.py %t +// RUN: diff %t %S/../../docs/ClangFormatStyleOptions.rst diff --git a/clang/test/Format/lit.local.cfg b/clang/test/Format/lit.local.cfg index 3eb0f54ceaa6f..8acf02725d701 100644 --- a/clang/test/Format/lit.local.cfg +++ b/clang/test/Format/lit.local.cfg @@ -17,4 +17,5 @@ config.suffixes = [ ".textpb", ".asciipb", ".td", + ".test" ]