From: Florian Schmidt <[email protected]> There are situations in which you might want to build QEMU without building the full test suite, which in some configurations can take a considerable amount of time to build. This is especially true when using LTO with clang. For example:
$ ../configure --cc=clang '--extra-ldflags=-flto=thin -ffat-lto-objects' '--extra-cflags=-flto=thin -ffat-lto-objects' --target-list=x86_64-softmmu [...] $ time make -j8 [...] [3078/3078] Linking target tests/qtest/qos-test real 6m43.250s user 101m15.967s sys 4m3.813s $ ../configure --cc=clang '--extra-ldflags=-flto=thin -ffat-lto-objects' '--extra-cflags=-flto=thin -ffat-lto-objects' --target-list=x86_64-softmmu --disable-tests [...] $ time make -j8 [...] [2024/2024] Linking target qemu-system-x86_64 real 3m14.277s user 33m13.174s sys 1m36.642s Add a toggle to optionally disable building tests. Signed-off-by: Florian Schmidt <[email protected]> Reviewed-by: Pierrick Bouvier <[email protected]> Tested-by: Pierrick Bouvier <[email protected]> Message-ID: <[email protected]> Signed-off-by: Thomas Huth <[email protected]> --- meson.build | 2 +- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ec9b05414a..2a12071cf0 100644 --- a/meson.build +++ b/meson.build @@ -4611,7 +4611,7 @@ 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). tcg_tests_summary = {} -if host_os != 'emscripten' +if get_option('tests').allowed() and host_os != 'emscripten' subdir('tests') endif if gtk.found() diff --git a/meson_options.txt b/meson_options.txt index 292625af08..e3570a418a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -43,6 +43,8 @@ option('gdb', type: 'string', # on the configure script command line. After adding an option # here make sure to run "make update-buildoptions". +option('tests', type: 'feature', value: 'auto', + description: 'Build the test suite') option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') option('fuzzing', type : 'boolean', value: false, diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 5a67e59a16..ba3c9de216 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -195,6 +195,7 @@ meson_options_help() { printf "%s\n" ' spice-protocol Spice protocol support' printf "%s\n" ' stack-protector compiler-provided stack protection' printf "%s\n" ' tcg TCG support' + printf "%s\n" ' tests build test suite' printf "%s\n" ' tools build support utilities that come with QEMU' printf "%s\n" ' tpm TPM support' printf "%s\n" ' u2f U2F emulation support' @@ -518,6 +519,8 @@ _meson_option_parse() { --enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=true ;; --disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=false ;; --tls-priority=*) quote_sh "-Dtls_priority=$2" ;; + --enable-tests) printf "%s" -Dtests=enabled ;; + --disable-tests) printf "%s" -Dtests=disabled ;; --enable-tools) printf "%s" -Dtools=enabled ;; --disable-tools) printf "%s" -Dtools=disabled ;; --enable-tpm) printf "%s" -Dtpm=enabled ;; -- 2.55.0
