mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: avoid re-execing test once for each mock
When debugging tests under GDB/valgrind there is a significant delay each time an execve is done as they scan shared libraries once again. For tests which use many mock libraries, we have been invoking execve many times which makes the debug experience horrible. This changes our framework to activate the full set of mock libraries in one single execve. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
@@ -46,8 +46,14 @@ main(int argc, char **argv)
|
||||
{
|
||||
virThread thread;
|
||||
virQEMUCapsPtr caps;
|
||||
const char *mock = VIR_TEST_MOCK("qemucapsprobe");
|
||||
|
||||
VIR_TEST_PRELOAD(VIR_TEST_MOCK("qemucapsprobe"));
|
||||
if (!virFileIsExecutable(mock)) {
|
||||
perror(mock);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
VIR_TEST_PRELOAD(mock);
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "%s QEMU_binary\n", argv[0]);
|
||||
|
||||
Reference in New Issue
Block a user