mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
tests: Fix commandtest in VPATH build
This commit is contained in:
parent
3c63a15b77
commit
ea8389dd3d
@ -544,19 +544,26 @@ cleanup:
|
|||||||
static int test15(const void *unused ATTRIBUTE_UNUSED)
|
static int test15(const void *unused ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
|
virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
|
||||||
|
char *cwd = NULL;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
virCommandSetWorkingDirectory(cmd, abs_builddir "/commanddata");
|
if (virAsprintf(&cwd, "%s/commanddata", abs_srcdir) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
virCommandSetWorkingDirectory(cmd, cwd);
|
||||||
|
|
||||||
if (virCommandRun(cmd, NULL) < 0) {
|
if (virCommandRun(cmd, NULL) < 0) {
|
||||||
virErrorPtr err = virGetLastError();
|
virErrorPtr err = virGetLastError();
|
||||||
printf("Cannot run child %s\n", err->message);
|
printf("Cannot run child %s\n", err->message);
|
||||||
virCommandFree(cmd);
|
goto cleanup;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = checkoutput("test15");
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
VIR_FREE(cwd);
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
|
|
||||||
return checkoutput("test15");
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user