]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check for libxml2
authorMark Andrews <marka@isc.org>
Tue, 18 Aug 2015 12:00:31 +0000 (22:00 +1000)
committerMark Andrews <marka@isc.org>
Tue, 18 Aug 2015 12:05:15 +0000 (22:05 +1000)
bin/tests/system/statistics/Makefile.in
bin/tests/system/statistics/tests.sh
bin/tests/system/statistics/xmlstats.c [new file with mode: 0644]

index 7c06c5ca44b6a083cb043618c7ce08556bbb68ec..7ac61b39d80517e17b1e15561a8b128d964fff87 100644 (file)
@@ -37,19 +37,23 @@ DEPLIBS =
 
 LIBS =         @LIBS@
 
-TARGETS =      newstats@EXEEXT@
+TARGETS =      newstats@EXEEXT@ xmlstats@EXEEXT@
 
 FILTEROBJS =   newstats.@O@
+XMLOBJS =      xmlstats.@O@
 
-SRCS =         newstats.c
+SRCS =         newstats.c xmlstats.c
 
 @BIND9_MAKE_RULES@
 
-all: newstats@EXEEXT@
+all: newstats@EXEEXT@ xmlstats.c
 
 newstats@EXEEXT@: ${FILTEROBJS}
        ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${FILTEROBJS} ${LIBS}
 
+xmlstats@EXEEXT@: ${XMLOBJS}
+       ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${XMLOBJS} ${LIBS}
+
 clean distclean::
        rm -f ${TARGETS}
 
index 6df2c0a5070044a75c6d1c4f0ae8c07a327b1c2d..94b6a66fd3e870465b1e075e10a85275e226f0f9 100644 (file)
@@ -29,7 +29,7 @@ t=0
 ret=0
 t=`expr $t + 1`
 echo "I:checking that zones with slash are properly shown in XML output (${t})"
-if [ -x ${CURL} ] ; then
+if ./xmlstats && [ -x ${CURL} ] ; then
     if ./newstats
     then
         ${CURL} http://10.53.0.1:8053/xml/v3 > curl.out.${t} 2>/dev/null || ret=1
@@ -43,7 +43,7 @@ awk '/<zone>/ { count=1 ; next }
      END { if (good) exit (0); exit (1) }' curl.out.${t} || ret=1
     fi
 else
-  echo "I:skipping test as curl was not found"
+  echo "I:skipping test as libxml2 and/or curl was not found"
 fi
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
diff --git a/bin/tests/system/statistics/xmlstats.c b/bin/tests/system/statistics/xmlstats.c
new file mode 100644 (file)
index 0000000..a6f8a1b
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2015  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <config.h>
+#include <isc/util.h>
+
+int
+main(int argc, char **argv) {
+
+       UNUSED(argc);
+       UNUSED(argv);
+
+#ifdef HAVE_LIBXML2
+       return (0);
+#else
+       return (1);
+#endif
+}