提交 dd214b5f 编写于 作者: J Jiri Denemark

tests: Create a shared library with qemu driver

Currently all qemu driver tests are statically linked to qemu driver
library, which makes it impossible to mock any API from the library.
This patch creates a shared qemu driver library which can be used
instead of the static one.

NB we can't use libvirt_driver_qemu.so directly since it is linked with
-module and it is supposed to be dlopened.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 9e0bb1c8
...@@ -51,6 +51,11 @@ MOCKLIBS_LDFLAGS = -module -avoid-version \ ...@@ -51,6 +51,11 @@ MOCKLIBS_LDFLAGS = -module -avoid-version \
-rpath /evil/libtool/hack/to/force/shared/lib/creation \ -rpath /evil/libtool/hack/to/force/shared/lib/creation \
$(MINGW_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS)
QEMULIB_LDFLAGS = \
-avoid-version \
-rpath /evil/libtool/hack/to/force/shared/lib/creation \
$(MINGW_EXTRA_LDFLAGS)
if WITH_DRIVER_MODULES if WITH_DRIVER_MODULES
INCLUDES += \ INCLUDES += \
-DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\" -DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\"
...@@ -418,6 +423,7 @@ test_libraries = libshunload.la \ ...@@ -418,6 +423,7 @@ test_libraries = libshunload.la \
$(NULL) $(NULL)
if WITH_QEMU if WITH_QEMU
test_libraries += libqemumonitortestutils.la \ test_libraries += libqemumonitortestutils.la \
libqemutestdriver.la \
qemuxml2argvmock.la \ qemuxml2argvmock.la \
qemucaps2xmlmock.la \ qemucaps2xmlmock.la \
$(NULL) $(NULL)
...@@ -546,6 +552,10 @@ if WITH_DTRACE_PROBES ...@@ -546,6 +552,10 @@ if WITH_DTRACE_PROBES
qemu_LDADDS += ../src/libvirt_qemu_probes.lo qemu_LDADDS += ../src/libvirt_qemu_probes.lo
endif WITH_DTRACE_PROBES endif WITH_DTRACE_PROBES
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(QEMULIB_LDFLAGS)
libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
qemuxml2argvtest_SOURCES = \ qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \ qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h testutils.c testutils.h
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册