]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add tests build option to enable/disable unit tests
authorPavel Hrdina <phrdina@redhat.com>
Thu, 8 Oct 2020 12:46:03 +0000 (14:46 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 9 Oct 2020 11:44:54 +0000 (13:44 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
libvirt.spec.in
meson.build
meson_options.txt

index 440704936b4abf8247e9e8ef677d320bc26d40ad..ee5bfb8123992c1fac86396221336e8e111e54e0 100644 (file)
@@ -1185,6 +1185,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
            -Dexpensive_tests=enabled \
            -Dinit_script=systemd \
            -Ddocs=enabled \
+           -Dtests=enabled \
            %{?arg_login_shell}
 
 %meson_build
index a4aac2f9db08903d269303a171770884e3e1f9e3..a17d759702df3cf83d912803c3af638bfc803577 100644 (file)
@@ -2197,7 +2197,10 @@ subdir('src')
 
 subdir('tools')
 
-subdir('tests')
+build_tests = not get_option('tests').disabled()
+if build_tests
+  subdir('tests')
+endif
 
 subdir('examples')
 
@@ -2432,6 +2435,7 @@ misc_summary = {
   'Use -Werror': cc_flags.contains('-Werror'),
   'Warning Flags': supported_cc_flags,
   'docs': gen_docs,
+  'tests': build_tests,
   'DTrace': conf.has('WITH_DTRACE_PROBES'),
   'firewalld': conf.has('WITH_FIREWALLD'),
   'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'),
index 52b6e31d160c47cc195cf62daa45a7019d9622c2..e5d79c2b6b463c20f6e6eba5b3de8b707a5fb9d9 100644 (file)
@@ -8,6 +8,7 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod
 option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT')
 option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries')
 option('docs', type: 'feature', value: 'auto', description: 'whether to generate documentation')
+option('tests', type: 'feature', value: 'auto', description: 'whether to build tests')
 
 
 # build dependencies options