[libsoup/wip/docs-updates: 6/9] build: Add option to validate docs




commit a6581262c62ec39409e614f0e8f6763878a7d37d
Author: Patrick Griffis <pgriffis igalia com>
Date:   Thu Apr 14 12:40:08 2022 -0500

    build: Add option to validate docs

 docs/reference/meson.build | 11 +++++++++++
 meson.build                |  1 +
 meson_options.txt          |  6 ++++++
 3 files changed, 18 insertions(+)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index d868201c..32f6f748 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -46,4 +46,15 @@ if gidocgen_dep.found()
     install: true,
     install_dir: docs_dir,
   )
+
+  if get_option('doc_tests')
+    test('docs', gidocgen,
+      args: [
+        'check',
+        '--add-include-path=@0@'.format(meson.current_build_dir() / '../../libsoup'),
+        '--config=@0@'.format(libsoup_toml),
+        soup_gir_gen_sources[0],
+      ]
+    )
+  endif
 endif
\ No newline at end of file
diff --git a/meson.build b/meson.build
index 6ac3ebad..d878d2e9 100644
--- a/meson.build
+++ b/meson.build
@@ -431,6 +431,7 @@ summary({
     'All tests' : get_option('tests'),
     'Tests requiring Apache' : have_apache,
     'Tests requiring Quart' : quart_found,
+    'Documentation tests' : get_option('doc_tests'),
     'Fuzzing tests' : get_option('fuzzing').enabled(),
     'Autobahn tests' : have_autobahn,
     'PKCS #11 tests' : gnutls_dep.found(),
diff --git a/meson_options.txt b/meson_options.txt
index 85c09058..64c0e835 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -53,6 +53,12 @@ option('docs',
   description: 'Enable generating the API reference'
 )
 
+option('doc_tests',
+  type: 'boolean',
+  value: false,
+  description: 'Enable strict validation of API docs'
+)
+
 option('tests',
   type: 'boolean',
   value: true,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]