meson: add an option to skip building tests

This commit is contained in:
Kirill Zhumarin 2026-10-29 21:44:31 +03:00
parent 7d31a86ca9
commit 24bf99ba5c
3 changed files with 6 additions and 1 deletions

View file

@ -4637,7 +4637,7 @@ subdir('docs')
subdir('pyvenv')
# Tests are disabled on emscripten because they rely on host features that aren't
# supported by emscripten (e.g. fork and unix socket).
if host_os != 'emscripten'
if host_os != 'emscripten' and get_option('tests')
subdir('tests')
endif
if gtk.found()

View file

@ -55,6 +55,8 @@ option('module_upgrades', type : 'boolean', value : false,
description: 'try to load modules from alternate paths for upgrades')
option('install_blobs', type : 'boolean', value : true,
description: 'install provided firmware blobs')
option('tests', type : 'boolean', value : true,
description: 'build unit tests and benchmarks')
option('sparse', type : 'feature', value : 'auto',
description: 'sparse checker')
option('guest_agent', type : 'feature', value : 'auto',

View file

@ -19,6 +19,7 @@ meson_options_help() {
printf "%s\n" ' --disable-install-blobs install provided firmware blobs'
printf "%s\n" ' --disable-qom-cast-debug cast debugging support'
printf "%s\n" ' --disable-relocatable toggle relocatable install'
printf "%s\n" ' --disable-tests build unit tests and benchmarks'
printf "%s\n" ' --docdir=VALUE Base directory for documentation installation'
printf "%s\n" ' (can be empty) [share/doc]'
printf "%s\n" ' --enable-asan enable address sanitizer'
@ -514,6 +515,8 @@ _meson_option_parse() {
--disable-tcg) printf "%s" -Dtcg=disabled ;;
--enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=true ;;
--disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=false ;;
--enable-tests) printf "%s" -Dtests=true ;;
--disable-tests) printf "%s" -Dtests=false ;;
--tls-priority=*) quote_sh "-Dtls_priority=$2" ;;
--enable-tools) printf "%s" -Dtools=enabled ;;
--disable-tools) printf "%s" -Dtools=disabled ;;