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

[libvirt] [PATCH 3/4] tests: Fix commandtest in VPATH build



---
 tests/commandtest.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tests/commandtest.c b/tests/commandtest.c
index 48c6335..e8decd3 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -587,12 +587,15 @@ cleanup:
 static int test15(const void *unused ATTRIBUTE_UNUSED)
 {
     virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
+    char *cwd = NULL;
     int ret = -1;
 
     if (!cmd)
         return -1;
 
-    virCommandSetWorkingDirectory(cmd, abs_builddir "/commanddata");
+    if (virAsprintf(&cwd, "%s/commanddata", abs_srcdir) < 0)
+        goto cleanup;
+    virCommandSetWorkingDirectory(cmd, cwd);
 
     if (virCommandRun(cmd, NULL) < 0) {
         virErrorPtr err = virGetLastError();
@@ -603,6 +606,7 @@ static int test15(const void *unused ATTRIBUTE_UNUSED)
     ret = checkoutput("test15");
 
 cleanup:
+    VIR_FREE(cwd);
     virCommandFree(cmd);
     return ret;
 }
-- 
1.7.3.2


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