]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: tests: add test scripts
authorPavel Hrdina <phrdina@redhat.com>
Mon, 27 Jul 2020 09:43:11 +0000 (11:43 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:06 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
tests/Makefile.am
tests/meson.build
tests/virt-aa-helper-test

index e691919c99550fec0363e2d7fbb603a6c6d66fc4..24ae515a3900e80e7b5e84ed9a0308895d0e8af4 100644 (file)
 ## 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
@@ -59,8 +27,6 @@ file-access-clean:
        > test_file_access.txt
 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
index cd59730d213f6fb49d98c2a782a0f7f75069b49f..03ec061ac8ecf79dba3c6046d350a793072a5640 100644 (file)
@@ -641,3 +641,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
index 8dbe82a6b982ff648277622a6f4f2979a9736cc8..83f53acef6122da1f03f628bb83773da3332e0ce 100755 (executable)
@@ -15,13 +15,13 @@ fi
 
 output="/dev/null"
 use_valgrind=""
-ld_library_path="../src/"
+ld_library_path="$abs_top_builddir/src/"
 if [ ! -z "$1" ] && [ "$1" = "-d" ]; then
     output="/dev/stdout"
     shift
 fi
 
-exe="../src/virt-aa-helper"
+exe="$abs_top_builddir/src/virt-aa-helper"
 if [ ! -z "$1" ]; then
     if [ "$1" = "-v" ]; then
         use_valgrind="yes"