Re: [PATCH 2/3] tests: Need help... Trying to add virRandomBytes mock

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

 



On Wed, May 18, 2016 at 19:52:31 -0400, John Ferlan wrote:
> What I'd like to do is merge this and the previous patch together;
> however, I'm missing something (hopefully obvious) with the building
> of the mocked function.
> 
> Since this won't be a qemu specific function, the test wouldn't belong
> in qemuxml2argvmock - rather a separate mock would seemingly have to be
> created and then a separate virrandomtest; however, I'm lost in the
> maze of Makefile magic - so hopefully someone can help... The current
> code works, but generates a nefarious:
> 
> *** Warning: Linking the executable virrandomtest against the loadable module
> *** virrandommock.so is not portable!
> 
> during the build...

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6ba6c5b..9d1a2ea 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1085,7 +1085,6 @@ vircryptotest_LDADD = $(LDADDS)
 virrandomtest_SOURCES = \
        virrandomtest.c testutils.h testutils.c
 virrandomtest_LDADD = \
-       virrandommock.la \
        ../src/libvirt.la \
        ../src/libvirt_util.la \
        $(GNULIB_LIBS)
diff --git a/tests/virrandomtest.c b/tests/virrandomtest.c
index 76e187c..bf1f46e 100644
--- a/tests/virrandomtest.c
+++ b/tests/virrandomtest.c
@@ -73,7 +73,7 @@ mymain(void)
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }

-VIRT_TEST_MAIN(mymain)
+VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virrandommock.so")

 #else

Attachment: signature.asc
Description: Digital signature

--
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]