]> granicus.if.org Git - sysstat/commitdiff
Add new non regression tests for XML output
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 14 Oct 2018 15:02:28 +0000 (17:02 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 14 Oct 2018 15:02:28 +0000 (17:02 +0200)
Add two new non regression tests that check the XML output of
sadf -x against DTD and XSD documents.
The tests are run only if the xmllint command exists.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
.gitignore
Makefile.in
configure
configure.in
tests/0240.in [new file with mode: 0644]
tests/0250.in [new file with mode: 0644]

index 4c7fe50f5ee566c4241a4d806be3da8438c8a0de..bb38ce74a5de1a1f38d88cc35f9507be1fe39849 100644 (file)
@@ -50,3 +50,5 @@ TAGS
 nls/*.gmo
 tests/*.tmp
 tests/0230
+tests/0240
+tests/0250
index eedb7e1ba6686f6d53cc3bb5ce7da19804b441fb..564fa9e5263ac4fcfeae5755ee582ba5ed069491 100644 (file)
@@ -600,7 +600,7 @@ almost-distclean: clean nls/sysstat.pot
        rm -f cron/sysstat-collect.service cron/sysstat-collect.timer cron/sysstat-summary.service cron/sysstat-summary.timer
        rm -f cron/sysstat.cron.hourly cron/sysstat.crond.sample cron/sysstat.crond.sample.in
        rm -f man/sa1.8 man/sa2.8 man/sadc.8 man/sadf.1 man/sar.1 man/iostat.1 man/sysstat.5
-       rm -f tests/0230
+       rm -f tests/0230 tests/0240 tests/0250
        rm -f man/cifsiostat.1
        rm -f *.log config.status
        rm -rf autom4te.cache
index b8077fef0c8351aeb369565b160de43e394f1512..9a5424c5ae418db478f53b15aea8bbb4bef00225 100755 (executable)
--- a/configure
+++ b/configure
@@ -673,6 +673,7 @@ INSTALL_BIN
 INSTALL_DATA
 ZIP
 VER_JSON
+VER_XML
 MSGMERGE
 XGETTEXT
 MSGFMT
@@ -3784,6 +3785,43 @@ $as_echo "no" >&6; }
 fi
 
 
+# Extract the first word of "xmllint", so it can be a program name with args.
+set dummy xmllint; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_VER_XML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$VER_XML"; then
+  ac_cv_prog_VER_XML="$VER_XML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_VER_XML="xmllint"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+VER_XML=$ac_cv_prog_VER_XML
+if test -n "$VER_XML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VER_XML" >&5
+$as_echo "$VER_XML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 for ac_prog in json_verify json_pp
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -3877,6 +3915,7 @@ INSTALL_BIN="\${INSTALL} -m 755"
 
 
 
+
 # Extract the first word of "cp", so it can be a program name with args.
 set dummy cp; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -5462,6 +5501,10 @@ ac_config_files="$ac_config_files man/cifsiostat.1:man/cifsiostat.in"
        # File must be renamed
 ac_config_files="$ac_config_files tests/0230"
 
+ac_config_files="$ac_config_files tests/0240"
+
+ac_config_files="$ac_config_files tests/0250"
+
 
 ac_config_files="$ac_config_files Makefile"
 
@@ -6195,6 +6238,8 @@ do
     "man/iostat.1") CONFIG_FILES="$CONFIG_FILES man/iostat.1:man/iostat.in" ;;
     "man/cifsiostat.1") CONFIG_FILES="$CONFIG_FILES man/cifsiostat.1:man/cifsiostat.in" ;;
     "tests/0230") CONFIG_FILES="$CONFIG_FILES tests/0230" ;;
+    "tests/0240") CONFIG_FILES="$CONFIG_FILES tests/0240" ;;
+    "tests/0250") CONFIG_FILES="$CONFIG_FILES tests/0250" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
index acf869ecec5fc58f53cd0e678ca9114f31411d3d..bff63fd525a5a3c06e75a09c66cf9f9e9c9f51e6 100644 (file)
@@ -30,6 +30,7 @@ AC_CHECK_PROG(INSTALL, install, install)
 AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt)
 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
 AC_CHECK_PROG(MSGMERGE, msgmerge, msgmerge)
+AC_CHECK_PROG(VER_XML, xmllint, xmllint)
 AC_CHECK_PROGS(VER_JSON, json_verify json_pp, true)
 AC_CHECK_PROGS(ZIP, xz bzip2 gzip, gzip)
 INSTALL_DATA="\${INSTALL} -m 644"
@@ -38,6 +39,7 @@ INSTALL_BIN="\${INSTALL} -m 755"
 AC_SUBST(INSTALL_BIN)
 
 AC_SUBST(VER_JSON)
+AC_SUBST(VER_XML)
 
 AC_PATH_PROG(PATH_CP, cp)
 AC_PATH_PROG(PATH_CHKCONFIG, chkconfig)
@@ -602,6 +604,8 @@ AC_CONFIG_FILES([man/sysstat.5:man/sysstat.in])     # File must be renamed
 AC_CONFIG_FILES([man/iostat.1:man/iostat.in])  # File must be renamed
 AC_CONFIG_FILES([man/cifsiostat.1:man/cifsiostat.in])  # File must be renamed
 AC_CONFIG_FILES([tests/0230])
+AC_CONFIG_FILES([tests/0240])
+AC_CONFIG_FILES([tests/0250])
 
 AC_OUTPUT(Makefile)
 
diff --git a/tests/0240.in b/tests/0240.in
new file mode 100644 (file)
index 0000000..52915d3
--- /dev/null
@@ -0,0 +1,4 @@
+VER_XML=@VER_XML@
+if [ ! -z "$VER_XML" ]; then
+       ./sadf -x tests/data.tmp -C -- -A | $VER_XML --schema xml/sysstat.xsd - >/dev/null;
+fi
diff --git a/tests/0250.in b/tests/0250.in
new file mode 100644 (file)
index 0000000..e028cb2
--- /dev/null
@@ -0,0 +1,4 @@
+VER_XML=@VER_XML@
+if [ ! -z "$VER_XML" ]; then
+       ./sadf -x tests/data.tmp -C -- -A | $VER_XML --dtdvalid xml/sysstat-*.dtd - >/dev/null;
+fi