[Libosinfo] [libosinfo PATCH 10/10] test-os: Add test_devices_duplication()

Daniel P. Berrangé berrange at redhat.com
Mon Nov 19 15:50:57 UTC 2018


On Thu, Nov 08, 2018 at 08:18:48PM +0100, Fabiano Fidêncio wrote:
> As devices are inherited from entries that "derives-from" or "clones"
> any other entries, there's not reason to keep declaring them in several
> places.
> 
> By adding this test, hopefully there'll be no more devices duplication
> from now on.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1634807
> 
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> ---
>  tests/Makefile.am |   2 +-
>  tests/test-os.c   | 144 ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 145 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 06f81bf..4612f69 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -60,7 +60,7 @@ test_product_SOURCES = test-product.c
>  
>  test_os_LDADD = $(COMMON_LDADD)
>  test_os_CFLAGS = $(COMMON_CFLAGS)
> -test_os_SOURCES = test-os.c
> +test_os_SOURCES = test-os.c ../osinfo/osinfo_product.c

This is breaking the test on BSD, because it causes the generated
test-os binary to contain 2 copies of the osinfo_product.c
code, one linked in here, and the other from libosinfo.so

Some compilers would merge the duplicates, but BSD won't so
you get duplicate types

(/usr/home/jenkins/libosinfo/build/tests/.libs/test-os:50006): GLib-GObject-WARNING **: 14:10:38.823: cannot register existing type 'OsinfoProduct'


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the Libosinfo mailing list