[PATCH] Re-add gnulib-tool unit tests.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since Bruno Haible quickly added support in gnulib-tool
to do what I wanted, the least I can do is to re-add the
tests in libvirt.  This does it:

The manual changes in this delta are very small:
just the first few files listed below.
I've also included some induced diffs, due to libvirt-prompted
fixes in gnulib.

I've omitted the 2000+ lines of diffs for all of the added files.

FYI, this is using stock gnulib-tool with one addition:
the m4_foreach_w patch for which I'm still awaiting feedback.

	Add gnulib-tool unit tests.
        * bootstrap: Re-add --with-tests, now that gnulib-tool
        arranges to use separate libraries for lib/ and tests/.
        * configure.in (AC_OUTPUT): Add gnulib/tests/Makefile.in.
        * Makefile.am (SUBDIRS): Add gnulib/tests.

        * gnulib/tests/Makefile.am: New file.
        * gnulib/lib/.cvsignore: Sort.
        * gnulib/lib/Makefile.am, gnulib/m4/getdelim.m4, gnulib/m4/getline.m4:
        * gnulib/m4/gnulib-cache.m4, gnulib/m4/gnulib-comp.m4: Regenerate.


        * gnulib/tests/test-alloca-opt.c: New file, from gnulib.
        * gnulib/tests/test-arpa_inet.c: Likewise.
        * gnulib/tests/test-fseeko.c: Likewise.
        * gnulib/tests/test-fseeko.sh: Likewise.
        * gnulib/tests/test-getaddrinfo.c: Likewise.
        * gnulib/tests/test-getdelim.c: Likewise.
        * gnulib/tests/test-getline.c: Likewise.
        * gnulib/tests/test-lseek.c: Likewise.
        * gnulib/tests/test-lseek.sh: Likewise.
        * gnulib/tests/test-netinet_in.c: Likewise.
        * gnulib/tests/test-snprintf.c: Likewise.
        * gnulib/tests/test-stdbool.c: Likewise.
        * gnulib/tests/test-stdint.c: Likewise.
        * gnulib/tests/test-stdio.c: Likewise.
        * gnulib/tests/test-stdlib.c: Likewise.
        * gnulib/tests/test-string.c: Likewise.
        * gnulib/tests/test-sys_select.c: Likewise.
        * gnulib/tests/test-sys_socket.c: Likewise.
        * gnulib/tests/test-sys_stat.c: Likewise.
        * gnulib/tests/test-sys_time.c: Likewise.
        * gnulib/tests/test-unistd.c: Likewise.
        * gnulib/tests/test-vasnprintf.c: Likewise.
        * gnulib/tests/test-vasprintf.c: Likewise.
        * gnulib/tests/test-wchar.c: Likewise.
        * gnulib/tests/dummy.c: Likewise.
        * gnulib/tests/intprops.h: Likewise.
        * gnulib/tests/verify.h: Likewise.
---
 Makefile.am                     |    2 +-
 bootstrap                       |    1 +
 configure.in                    |    1 +
 gnulib/lib/.cvsignore           |    8 +-
 gnulib/lib/Makefile.am          |    2 +-
 gnulib/m4/getdelim.m4           |    4 +-
 gnulib/m4/getline.m4            |    4 +-
 gnulib/m4/gnulib-cache.m4       |    3 +-
 gnulib/m4/gnulib-comp.m4        |   87 +++++++++-
 gnulib/tests/Makefile.am        |  271 +++++++++++++++++++++++++++++
 gnulib/tests/dummy.c            |   42 +++++
 gnulib/tests/intprops.h         |   77 +++++++++
 gnulib/tests/test-alloca-opt.c  |   62 +++++++
 gnulib/tests/test-arpa_inet.c   |   27 +++
 gnulib/tests/test-fseeko.c      |   35 ++++
 gnulib/tests/test-fseeko.sh     |    5 +
 gnulib/tests/test-getaddrinfo.c |  137 +++++++++++++++
 gnulib/tests/test-getdelim.c    |   89 ++++++++++
 gnulib/tests/test-getline.c     |   89 ++++++++++
 gnulib/tests/test-lseek.c       |  102 +++++++++++
 gnulib/tests/test-lseek.sh      |   17 ++
 gnulib/tests/test-netinet_in.c  |   27 +++
 gnulib/tests/test-snprintf.c    |   71 ++++++++
 gnulib/tests/test-stdbool.c     |   95 +++++++++++
 gnulib/tests/test-stdint.c      |  356 +++++++++++++++++++++++++++++++++++++++
 gnulib/tests/test-stdio.c       |   30 ++++
 gnulib/tests/test-stdlib.c      |   37 ++++
 gnulib/tests/test-string.c      |   27 +++
 gnulib/tests/test-sys_select.c  |   27 +++
 gnulib/tests/test-sys_socket.c  |   47 +++++
 gnulib/tests/test-sys_stat.c    |  260 ++++++++++++++++++++++++++++
 gnulib/tests/test-sys_time.c    |   29 +++
 gnulib/tests/test-unistd.c      |   44 +++++
 gnulib/tests/test-vasnprintf.c  |  127 ++++++++++++++
 gnulib/tests/test-vasprintf.c   |   88 ++++++++++
 gnulib/tests/test-wchar.c       |   27 +++
 gnulib/tests/verify.h           |  140 +++++++++++++++
 37 files changed, 2486 insertions(+), 11 deletions(-)
 create mode 100644 gnulib/tests/Makefile.am
 create mode 100644 gnulib/tests/dummy.c
 create mode 100644 gnulib/tests/intprops.h
 create mode 100644 gnulib/tests/test-alloca-opt.c
 create mode 100644 gnulib/tests/test-arpa_inet.c
 create mode 100644 gnulib/tests/test-fseeko.c
 create mode 100755 gnulib/tests/test-fseeko.sh
 create mode 100644 gnulib/tests/test-getaddrinfo.c
 create mode 100644 gnulib/tests/test-getdelim.c
 create mode 100644 gnulib/tests/test-getline.c
 create mode 100644 gnulib/tests/test-lseek.c
 create mode 100755 gnulib/tests/test-lseek.sh
 create mode 100644 gnulib/tests/test-netinet_in.c
 create mode 100644 gnulib/tests/test-snprintf.c
 create mode 100644 gnulib/tests/test-stdbool.c
 create mode 100644 gnulib/tests/test-stdint.c
 create mode 100644 gnulib/tests/test-stdio.c
 create mode 100644 gnulib/tests/test-stdlib.c
 create mode 100644 gnulib/tests/test-string.c
 create mode 100644 gnulib/tests/test-sys_select.c
 create mode 100644 gnulib/tests/test-sys_socket.c
 create mode 100644 gnulib/tests/test-sys_stat.c
 create mode 100644 gnulib/tests/test-sys_time.c
 create mode 100644 gnulib/tests/test-unistd.c
 create mode 100644 gnulib/tests/test-vasnprintf.c
 create mode 100644 gnulib/tests/test-vasprintf.c
 create mode 100644 gnulib/tests/test-wchar.c
 create mode 100644 gnulib/tests/verify.h

diff --git a/Makefile.am b/Makefile.am
index d12f3aa..c49c533 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in

-SUBDIRS = gnulib/lib include src qemud proxy docs \
+SUBDIRS = gnulib/lib include src qemud proxy docs gnulib/tests \
   @PYTHON_SUBDIR@ tests po scripts

 ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
diff --git a/bootstrap b/bootstrap
index d61d2e3..751b244 100755
--- a/bootstrap
+++ b/bootstrap
@@ -71,6 +71,7 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool

 $gnulib_tool			\
   --lgpl=2			\
+  --with-tests			\
   --m4-base=gnulib/m4		\
   --source-base=gnulib/lib	\
   --tests-base=gnulib/tests	\
diff --git a/configure.in b/configure.in
index 425bb4c..8e5cca4 100644
--- a/configure.in
+++ b/configure.in
@@ -678,6 +678,7 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
           docs/examples/Makefile docs/devhelp/Makefile \
 	  docs/examples/python/Makefile \
 	  gnulib/lib/Makefile \
+	  gnulib/tests/Makefile \
           libvirt.pc libvirt.spec \
           po/Makefile.in scripts/Makefile \
 	  include/libvirt/Makefile include/libvirt/libvirt.h \
diff --git a/gnulib/lib/.cvsignore b/gnulib/lib/.cvsignore
index 99e7fab..0f10d7f 100644
--- a/gnulib/lib/.cvsignore
+++ b/gnulib/lib/.cvsignore
@@ -1,11 +1,11 @@
-alloca.h
-.deps
-float.h
 *.la
-.libs
 *.lo
+.deps
+.libs
 Makefile
 Makefile.in
+alloca.h
+float.h
 netinet_in.h
 poll.h
 stdbool.h
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
index f1c4fa0..a94ed2d 100644
--- a/gnulib/lib/Makefile.am
+++ b/gnulib/lib/Makefile.am
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --lgpl=2 --libtool --macro-prefix=gl getaddrinfo getpass gettext physmem poll strndup strsep sys_stat vasprintf
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl getaddrinfo getpass gettext physmem poll strndup strsep sys_stat vasprintf

 AUTOMAKE_OPTIONS = 1.5 gnits

diff --git a/gnulib/m4/getdelim.m4 b/gnulib/m4/getdelim.m4
index 5563227..18b96be 100644
--- a/gnulib/m4/getdelim.m4
+++ b/gnulib/m4/getdelim.m4
@@ -1,4 +1,4 @@
-# getdelim.m4 serial 4
+# getdelim.m4 serial 5

 dnl Copyright (C) 2005, 2006, 2007 Free Software dnl Foundation, Inc.
 dnl
@@ -6,6 +6,8 @@ dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.

+AC_PREREQ([2.59])
+
 AC_DEFUN([gl_FUNC_GETDELIM],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
diff --git a/gnulib/m4/getline.m4 b/gnulib/m4/getline.m4
index e4ccd12..57625da 100644
--- a/gnulib/m4/getline.m4
+++ b/gnulib/m4/getline.m4
@@ -1,4 +1,4 @@
-# getline.m4 serial 17
+# getline.m4 serial 18

 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free
 dnl Software Foundation, Inc.
@@ -7,6 +7,8 @@ dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.

+AC_PREREQ([2.59])
+
 dnl See if there's a working, system-supplied version of the getline function.
 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
 dnl have a function by that name in -linet that doesn't have anything
diff --git a/gnulib/m4/gnulib-cache.m4 b/gnulib/m4/gnulib-cache.m4
index 05a4503..d55e07a 100644
--- a/gnulib/m4/gnulib-cache.m4
+++ b/gnulib/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@


 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --lgpl=2 --libtool --macro-prefix=gl getaddrinfo getpass gettext physmem poll strndup strsep sys_stat vasprintf
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl getaddrinfo getpass gettext physmem poll strndup strsep sys_stat vasprintf

 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
@@ -26,6 +26,7 @@ gl_M4_BASE([gnulib/m4])
 gl_PO_BASE([])
 gl_DOC_BASE([doc])
 gl_TESTS_BASE([gnulib/tests])
+gl_WITH_TESTS
 gl_LIB([libgnu])
 gl_LGPL([2])
 gl_MAKEFILE_NAME([])
diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
index 259e28b..d92a377 100644
--- a/gnulib/m4/gnulib-comp.m4
+++ b/gnulib/m4/gnulib-comp.m4
@@ -34,11 +34,11 @@ AC_DEFUN([gl_EARLY],
 # "Check for header files, types and library functions".
 AC_DEFUN([gl_INIT],
 [
+  AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
+  gl_cond_libtool=true
   m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
-  AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
-  gl_cond_libtool=true
   gl_source_base='gnulib/lib'
   gl_FUNC_ALLOCA
   gl_HEADER_ARPA_INET
@@ -120,6 +120,34 @@ AC_DEFUN([gl_INIT],
     AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
     AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
   ])
+  gltests_libdeps=
+  gltests_ltlibdeps=
+  m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
+  m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
+  m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
+  gl_source_base='gnulib/tests'
+  gt_TYPE_WCHAR_T
+  gt_TYPE_WINT_T
+  AC_CHECK_FUNCS([shutdown])
+  m4_popdef([AC_LIBSOURCES])
+  m4_popdef([AC_REPLACE_FUNCS])
+  m4_popdef([AC_LIBOBJ])
+  AC_CONFIG_COMMANDS_PRE([
+    gltests_libobjs=
+    gltests_ltlibobjs=
+    if test -n "$gltests_LIBOBJS"; then
+      # Remove the extension.
+      sed_drop_objext='s/\.o$//;s/\.obj$//'
+      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
+        gltests_libobjs="$gltests_libobjs $i.$ac_objext"
+        gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
+      done
+    fi
+    AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
+    AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
+  ])
+  LIBTESTS_LIBDEPS="$gltests_libdeps"
+  AC_SUBST([LIBTESTS_LIBDEPS])
 ])

 # Like AC_LIBOBJ, except that the module name goes
@@ -150,6 +178,34 @@ AC_DEFUN([gl_LIBSOURCES], [
   ])
 ])

+# Like AC_LIBOBJ, except that the module name goes
+# into gltests_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gltests_LIBOBJ], [
+  AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
+  gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
+])
+
+# Like AC_REPLACE_FUNCS, except that the module name goes
+# into gltests_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gltests_REPLACE_FUNCS], [
+  m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
+  AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
+])
+
+# Like AC_LIBSOURCES, except the directory where the source file is
+# expected is derived from the gnulib-tool parametrization,
+# and alloca is special cased (for the alloca-opt module).
+# We could also entirely rely on EXTRA_lib..._SOURCES.
+AC_DEFUN([gltests_LIBSOURCES], [
+  m4_foreach([_gl_NAME], [$1], [
+    m4_if(_gl_NAME, [alloca.c], [], [
+      m4_syscmd([test -r gnulib/tests/]_gl_NAME[ || test ! -d gnulib/tests])dnl
+      m4_if(m4_sysval, [0], [],
+        [AC_FATAL([missing gnulib/tests/]_gl_NAME)])
+    ])
+  ])
+])
+
 # This macro records the list of files which have been installed by
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
@@ -278,4 +334,31 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/wchar_t.m4
   m4/wint_t.m4
   m4/xsize.m4
+  tests/test-alloca-opt.c
+  tests/test-arpa_inet.c
+  tests/test-fseeko.c
+  tests/test-fseeko.sh
+  tests/test-getaddrinfo.c
+  tests/test-getdelim.c
+  tests/test-getline.c
+  tests/test-lseek.c
+  tests/test-lseek.sh
+  tests/test-netinet_in.c
+  tests/test-snprintf.c
+  tests/test-stdbool.c
+  tests/test-stdint.c
+  tests/test-stdio.c
+  tests/test-stdlib.c
+  tests/test-string.c
+  tests/test-sys_select.c
+  tests/test-sys_socket.c
+  tests/test-sys_stat.c
+  tests/test-sys_time.c
+  tests/test-unistd.c
+  tests/test-vasnprintf.c
+  tests/test-vasprintf.c
+  tests/test-wchar.c
+  tests=lib/dummy.c
+  tests=lib/intprops.h
+  tests=lib/verify.h
 ])

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]