]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: add check-augeas test
authorPavel Hrdina <phrdina@redhat.com>
Mon, 27 Jul 2020 07:11:42 +0000 (09:11 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:05 +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>
src/Makefile.am
src/meson.build

index 943d5991ee15f9f437a6773c9f173e4150a2c178..4ce424e1b4e51293e7203c1132eb7e3b39e89e37 100644 (file)
@@ -21,8 +21,6 @@
 # that actually use them.
 
 BUILT_SOURCES =
-augeas_DATA =
-augeastest_DATA =
 if WITH_DTRACE_PROBES
 tapset_DATA =
 endif WITH_DTRACE_PROBES
@@ -92,21 +90,6 @@ check-local: check-protocol \
 .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
 
 
-check-local: check-augeas
-
-check-augeas: $(augeas_DATA) $(augeastest_DATA)
-       $(AM_V_GEN) \
-       if test -x "$(AUGPARSE)"; then \
-           for f in $(augeastest_DATA); do \
-               DIR=$$(dirname "$$f"); \
-               FILE=$$(basename "$$f"); \
-               "$(AUGPARSE)" \
-                   -I "$(srcdir)/$$DIR" -I "$(builddir)/$$DIR" \
-                   "$$DIR/$$FILE" || exit 1; \
-           done; \
-       fi
-.PHONY: check-augeas
-
 if WITH_DTRACE_PROBES
 
 BUILT_SOURCES += libvirt_functions.stp
index f2a0ccea228894ea5a4b0527c68fd3761da1b432..162b09667b48c73039b833a98c11edcbf7e932e4 100644 (file)
@@ -667,6 +667,12 @@ foreach data : virt_test_aug_files
   )
 endforeach
 
+# augeas_test_data:
+#   each entry is a dictionary with following items:
+#   * name: daemon name to run the test for (required)
+#   * file: test file to use (required)
+augeas_test_data = []
+
 foreach data : virt_daemon_confs
   capitalize_args = [ '-c', 'print("@0@".capitalize())'.format(data['name']) ]
   name_uc = run_command(python3_prog, capitalize_args, check: true).stdout().strip()
@@ -717,7 +723,7 @@ foreach data : virt_daemon_confs
   )
 
   test_aug_out = 'test_@0@.aug'.format(data['name'])
-  custom_target(
+  augeas_test_file = custom_target(
     test_aug_out,
     input: [ conf_out, test_aug_tmp ],
     output: test_aug_out,
@@ -729,6 +735,7 @@ foreach data : virt_daemon_confs
     install: true,
     install_dir: virt_test_aug_dir,
   )
+  augeas_test_data += { 'name': data['name'], 'file': augeas_test_file }
 endforeach
 
 
@@ -886,3 +893,17 @@ test(
   args: [ check_aclrules_prog.path(), files('remote/remote_protocol.x'), stateful_driver_source_files ],
   env: runutf8,
 )
+
+if augparse_prog.found()
+  foreach data : augeas_test_data
+    test(
+      'check-augeas-@0@'.format(data['name']),
+      augparse_prog,
+      args: [
+        '-I', meson.current_source_dir(),
+        '-I', meson.current_build_dir(),
+        data['file'].full_path(),
+      ],
+    )
+  endforeach
+endif