| # Copyright 2022 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/testing/golden_files.gni") |
| import("//tools/cppdocgen/cpp_docgen.gni") |
| |
| generated_doc_dir = "$target_gen_dir/e2e_output" |
| |
| # Debugging notes: |
| # |
| # * To look at the YAML files that clang-doc generates, the intermediate output is in: |
| # out/<build-dir>/host_x64/gen/tools/cppdocgen/e2e_test/docgen_e2e_docs_clang_doc.zip |
| # Which you can unzip to a temporary directory to inspect. |
| # |
| # * To build this target and run the golden file tests, run: |
| # fx build host_x64/gen/tools/cppdocgen/e2e_test/e2e_test.verified |
| # |
| cpp_docgen("docgen_e2e_docs") { |
| headers = [ |
| "basics.h", |
| "classes.h", |
| "functions.h", |
| "grouping.h", |
| "namespace.h", |
| "templates.h", |
| ] |
| overview = "README.md" |
| |
| include_dir = ".." |
| library_name = "e2e" |
| out_dir = generated_doc_dir |
| |
| # This is not used since this target is never staged to devsite. |
| reference_repo_path = "e2e_test" |
| |
| # There is no actual library for these headers so we have nothing here, but the cpp_docgen |
| # template asserts that there are deps to catch the common case of the caller forgetting to depend |
| # on the real library. |
| deps = [] |
| } |
| |
| golden_files("e2e_test") { |
| testonly = true |
| |
| # Each of the "headers" in the docgen step above generates one .md file, plus the index file. The |
| # golden file is in this directory, the generated one is in generated_doc_dir. |
| comparisons = [ |
| { |
| golden = "_toc.yaml" |
| candidate = "$generated_doc_dir/_toc.yaml" |
| }, |
| { |
| golden = "basics.h.md" |
| candidate = "$generated_doc_dir/basics.h.md" |
| }, |
| { |
| golden = "classes.h.md" |
| candidate = "$generated_doc_dir/classes.h.md" |
| }, |
| { |
| golden = "functions.h.md" |
| candidate = "$generated_doc_dir/functions.h.md" |
| }, |
| { |
| golden = "grouping.h.md" |
| candidate = "$generated_doc_dir/grouping.h.md" |
| }, |
| { |
| golden = "index.md" |
| candidate = "$generated_doc_dir/index.md" |
| }, |
| { |
| golden = "namespace.h.md" |
| candidate = "$generated_doc_dir/namespace.h.md" |
| }, |
| { |
| golden = "templates.h.md" |
| candidate = "$generated_doc_dir/templates.h.md" |
| }, |
| ] |
| deps = [ ":docgen_e2e_docs" ] |
| } |