[PATCH] test: fix VPATH fchosttest failure

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

 



Running make check in a VPATH configured build directory fails
in fchosttest as the test data files are searched for relative to
the current working directory.

Signed-off-by: Viktor Mihajlovski <mihajlov@xxxxxxxxxxxxxxxxxx>
---
 This may become obsolete with Osier's pending patches, but
 it helps to get over the build failures for the moment... 

 tests/fchosttest.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tests/fchosttest.c b/tests/fchosttest.c
index 035f721..ccc2df9 100644
--- a/tests/fchosttest.c
+++ b/tests/fchosttest.c
@@ -19,10 +19,13 @@
 
 #include <config.h>
 
+#include "virstring.h"
 #include "virutil.h"
 #include "testutils.h"
 
-#define TEST_FC_HOST_PREFIX "./fchostdata/fc_host/"
+static char * fchost_prefix;
+
+#define TEST_FC_HOST_PREFIX fchost_prefix
 #define TEST_FC_HOST_NUM 5
 
 /* Test virIsCapableFCHost */
@@ -158,6 +161,12 @@ mymain(void)
 {
     int ret = 0;
 
+    if (virAsprintf(&fchost_prefix,"%s/%s", abs_srcdir,
+                    "fchostdata/fc_host/") < 0) {
+        ret = -1;
+        goto cleanup;
+    }
+
     if (virtTestRun("test1", 1, test1, NULL) < 0)
         ret = -1;
     if (virtTestRun("test2", 1, test2, NULL) < 0)
@@ -169,6 +178,8 @@ mymain(void)
     if (virtTestRun("test5", 1, test5, NULL) < 0)
         ret = -1;
 
+cleanup:
+    VIR_FREE(fchost_prefix);
     return ret;
 }
 
-- 
1.7.9.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]