From 55d0ab00a68caade5529fdda7decd6f752813519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 6 Feb 2022 12:51:54 +0100 Subject: [PATCH] meson: add -Dtests=false|true option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When set to false, no test binaries are neither built, nor executed (with “ninja test”). Closes #919 --- CHANGELOG.md | 8 ++++++++ meson.build | 6 +++++- meson_options.txt | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2377b4c..49278ef7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,15 @@ ## Unreleased + ### Added + +* `-Dtests=false|true` meson command line option. When disabled, test + binaries will neither be built, nor will `ninja test` attempt to + execute them. Enabled by default + (https://codeberg.org/dnkl/foot/issues/919). + + ### Changed ### Deprecated ### Removed diff --git a/meson.build b/meson.build index 81ef4f90..5f4148b1 100644 --- a/meson.build +++ b/meson.build @@ -283,7 +283,10 @@ endif subdir('completions') subdir('icons') -subdir('tests') + +if (get_option('tests')) + subdir('tests') +endif summary( { @@ -295,6 +298,7 @@ summary( 'Terminfo install location': terminfo_install_location, 'Default TERM': get_option('default-terminfo'), 'Set TERMINFO': get_option('custom-terminfo-install-location') != '', + 'Tests': get_option('tests'), }, bool_yn: true ) diff --git a/meson_options.txt b/meson_options.txt index ccc7d5a1..255ca0ae 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,6 +10,8 @@ option('ime', type: 'boolean', value: true, option('grapheme-clustering', type: 'feature', description: 'Enables grapheme clustering using libutf8proc. Requires fcft with harfbuzz support to be useful.') +option('tests', type: 'boolean', value: true, description: 'Build tests') + option('terminfo', type: 'feature', value: 'enabled', description: 'Build and install foot\'s terminfo files.') option('default-terminfo', type: 'string', value: 'foot', description: 'Default value of the "term" option in foot.ini.')