meson: add expensive_tests build option

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-24 16:07:05 +02:00
parent d69bc20d5f
commit 3a7faf84df
3 changed files with 10 additions and 21 deletions

View File

@ -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) ;;

View File

@ -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('.')

View File

@ -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')