From 3a7faf84df373bf881048f7f797daf34f42af74b Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Fri, 24 Jul 2020 16:07:05 +0200 Subject: [PATCH] meson: add expensive_tests build option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- configure.ac | 21 --------------------- meson.build | 9 +++++++++ meson_options.txt | 1 + 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index a533610c6c..f7e665bd45 100644 --- a/configure.ac +++ b/configure.ac @@ -614,27 +614,6 @@ if test -z "$PERL"; then AC_MSG_ERROR(['perl' binary is required to build libvirt]) fi -LIBVIRT_ARG_ENABLE([EXPENSIVE_TESTS], - [set the default for enabling expensive tests ] - [(long timeouts), use VIR_TEST_EXPENSIVE to ] - [override during make], - [check]) -case "$enable_expensive_tests" in - 0|no) VIR_TEST_EXPENSIVE_DEFAULT=0 ;; - 1|yes) VIR_TEST_EXPENSIVE_DEFAULT=1 ;; - check) ;; - *) AC_MSG_ERROR([bad value ${enable_expensive_tests} for enable-expensive-tests option]) ;; -esac -if test "$enable_expensive_tests" = check; then - if test -d $srcdir/.git ; then - VIR_TEST_EXPENSIVE_DEFAULT=0 - else - VIR_TEST_EXPENSIVE_DEFAULT=1 - fi -fi -AC_SUBST([VIR_TEST_EXPENSIVE_DEFAULT]) -AM_CONDITIONAL([WITH_EXPENSIVE_TESTS], [test $VIR_TEST_EXPENSIVE_DEFAULT = 1]) - LIBVIRT_ARG_ENABLE([TEST_COVERAGE], [turn on code coverage instrumentation], [no]) case "$enable_test_coverage" in yes|no) ;; diff --git a/meson.build b/meson.build index 61546f38af..f9173b1acd 100644 --- a/meson.build +++ b/meson.build @@ -129,6 +129,15 @@ if packager_version != '' endif +# test options + +if get_option('expensive_tests').auto() + use_expensive_tests = not git +else + use_expensive_tests = get_option('expensive_tests').enabled() +endif + + # figure out libvirt version strings arr_version = meson.project_version().split('.') diff --git a/meson_options.txt b/meson_options.txt index 7bb283177c..390c7d33fa 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,3 +4,4 @@ option('packager', type: 'string', value: '', description: 'Extra packager name' option('packager_version', type: 'string', value: '', description: 'Extra packager version') option('system', type: 'boolean', value: false, description: 'Set install paths to system ones') option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') +option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts), use VIR_TEST_EXPENSIVE to override')