[gi-docgen/wip/smcv/turn-off-dev-tests] build: Add an option to turn off development tests




commit 7d6ed5beefbc77ca120e5b5f1b6e76d9a3bbdb76
Author: Simon McVittie <smcv debian org>
Date:   Thu Apr 15 14:25:42 2021 +0100

    build: Add an option to turn off development tests
    
    Failing tests on imperfect coding style or type annotations is useful
    for developers, but unhelpful when a project is packaged, because the
    versions of flake8 and mypy used will vary over time.
    
    Signed-off-by: Simon McVittie <smcv debian org>

 meson.build       | 6 +++++-
 meson_options.txt | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 5384fe4..f359cc7 100644
--- a/meson.build
+++ b/meson.build
@@ -40,9 +40,13 @@ configure_file(
   install_dir: get_option('datadir') / 'pkgconfig',
 )
 
-# Development tests should not be run when in a subproject
 if not meson.is_subproject()
   install_subdir('gidocgen', install_dir: py.get_install_dir())
+endif
+
+# Development tests should not be run when in a subproject
+if get_option('development_tests') and not meson.is_subproject()
+  install_subdir('gidocgen', install_dir: py.get_install_dir())
 
   flake8 = find_program('flake8', required: false)
   if flake8.found()
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..1c7c291
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,4 @@
+option('development_tests',
+       type : 'boolean',
+       value : true,
+       description : 'run tests that are appropriate during gi-docgen development but not during packaging')


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