[libvirt PATCH 311/351] meson: tests: add test scripts

Pavel Hrdina phrdina at redhat.com
Thu Jul 16 09:59:07 UTC 2020


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 tests/Makefile.am | 34 ----------------------------------
 tests/meson.build | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 34 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 939d97a9985..641ed7b390b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,38 +16,6 @@
 ## License along with this library.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-test_scripts =
-libvirtd_test_scripts = \
-	libvirtd-fail \
-	libvirtd-pool \
-	virsh-auth \
-	virsh-cpuset \
-	virsh-define-dev-segfault \
-	virsh-int-overflow \
-	virsh-optparse \
-	virsh-read-bufsiz \
-	virsh-read-non-seekable \
-	virsh-schedinfo \
-	virsh-self-test \
-	virt-admin-self-test \
-	virsh-checkpoint \
-	virsh-snapshot \
-	virsh-start \
-	virsh-undefine \
-	virsh-uriprecedence \
-	virsh-vcpupin \
-	$(NULL)
-
-if WITH_LIBVIRTD
-test_scripts += $(libvirtd_test_scripts)
-endif ! WITH_LIBVIRTD
-
-if WITH_SECDRIVER_APPARMOR
-if WITH_LIBVIRTD
-test_scripts += virt-aa-helper-test
-endif WITH_LIBVIRTD
-endif WITH_SECDRIVER_APPARMOR
-
 if WITH_LINUX
 check-access: file-access-clean
 	VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check
@@ -60,8 +28,6 @@ file-access-clean:
 endif WITH_LINUX
 
 
-TESTS = $(test_scripts)
-
 VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \
 	--trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \
 	--suppressions=$(abs_srcdir)/.valgrind.supp
diff --git a/tests/meson.build b/tests/meson.build
index 5df9973ccf9..d6e0d2805d7 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -628,3 +628,40 @@ foreach data : helpers
     export_dynamic: true,
   )
 endforeach
+
+
+# test_scripts:
+#   list of test scripts to run
+test_scripts = []
+
+if conf.has('WITH_LIBVIRTD')
+  test_scripts += [
+    'libvirtd-fail',
+    'libvirtd-pool',
+    'virsh-auth',
+    'virsh-checkpoint',
+    'virsh-cpuset',
+    'virsh-define-dev-segfault',
+    'virsh-int-overflow',
+    'virsh-optparse',
+    'virsh-read-bufsiz',
+    'virsh-read-non-seekable',
+    'virsh-schedinfo',
+    'virsh-self-test',
+    'virsh-snapshot',
+    'virsh-start',
+    'virsh-undefine',
+    'virsh-uriprecedence',
+    'virsh-vcpupin',
+    'virt-admin-self-test',
+  ]
+
+  if conf.has('WITH_SECDRIVER_APPARMOR')
+    test_scripts += 'virt-aa-helper-test'
+  endif
+endif
+
+foreach name : test_scripts
+  script = find_program(name)
+  test(name, script, env: tests_env)
+endforeach
-- 
2.26.2




More information about the libvir-list mailing list