[gedit/zbrown/deteplification-src: 197/633] build: add require_all_tests option
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/zbrown/deteplification-src: 197/633] build: add require_all_tests option
- Date: Sat, 10 Apr 2021 12:47:58 +0000 (UTC)
commit 61b649ae6ed4bd1cfefa4dfe722397632a2df5df
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon Mar 16 10:59:34 2020 +0100
build: add require_all_tests option
Currently it's applied only to the data/ directory.
data/meson.build | 6 +++---
meson.build | 1 +
meson_options.txt | 10 ++++++++++
3 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 789b41d57..92fb4cf49 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -12,7 +12,7 @@ appdata_file = i18n.merge_file(
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'metainfo')
)
-appstream_util = find_program('appstream-util', required: false)
+appstream_util = find_program('appstream-util', required: get_option('require_all_tests'))
if appstream_util.found()
test(
'validate-appdata',
@@ -36,7 +36,7 @@ desktop_output_file = i18n.merge_file(
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'applications')
)
-desktop_file_validate = find_program('desktop-file-validate', required: false)
+desktop_file_validate = find_program('desktop-file-validate', required: get_option('require_all_tests'))
if desktop_file_validate.found()
test(
'validate-desktop',
@@ -79,7 +79,7 @@ gschema_dtd = join_paths(
'gschema.dtd',
)
-xmllint = find_program('xmllint', required: false)
+xmllint = find_program('xmllint', required: get_option('require_all_tests'))
if xmllint.found()
test(
'validate-gschema',
diff --git a/meson.build b/meson.build
index a3330c9f3..31f7ad42e 100644
--- a/meson.build
+++ b/meson.build
@@ -131,6 +131,7 @@ summary = [
' Prefix: @0@'.format(get_option('prefix')),
' API documentation: @0@'.format(get_option('gtk_doc')),
' User documentation: @0@'.format(get_option('user_documentation')),
+ ' Require all tests: @0@'.format(get_option('require_all_tests')),
'',
]
message('\n'.join(summary))
diff --git a/meson_options.txt b/meson_options.txt
index 40ac14a82..9a93f5cd3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,6 +4,16 @@ option(
description: 'Build API reference for plugins (requires gtk-doc)'
)
+# If this option is kept to false, then it's an automatic behavior: if the
+# third party program is found, then the test is defined.
+# Setting this option to true will stop the configure phase with a hard error
+# if a third party program is not found and is required to define a test.
+option(
+ 'require_all_tests',
+ type: 'boolean', value: false,
+ description: 'Require that all tests can be run, even those that depend on third party programs'
+)
+
# This option exists for the developers, to speed up the install.
option(
'user_documentation',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]