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




commit 515049832eaeba24ea22928a766873c860d1b295
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       | 4 +++-
 meson_options.txt | 8 ++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 5384fe4..c221d2a 100644
--- a/meson.build
+++ b/meson.build
@@ -40,10 +40,12 @@ 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()
   flake8 = find_program('flake8', required: false)
   if flake8.found()
     test('flake8',
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..b970a99
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,8 @@
+# SPDX-FileCopyrightText: 2021 Simon McVittie
+#
+# SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
+
+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]