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:
Daniel P. Berrangé
2020-01-09 18:01:44 +00:00
parent 66ec00ab3e
commit 975f2d1c90
3 changed files with 34 additions and 13 deletions

View File

@@ -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]);