]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test: fix VPATH fchosttest failure
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Thu, 16 May 2013 15:49:59 +0000 (17:49 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 17 May 2013 10:09:52 +0000 (12:09 +0200)
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@linux.vnet.ibm.com>
tests/fchosttest.c

index 035f72110e9869abef86387e848981bc87f467de..76d1795f754497939f9a555261cb985f91e59044 100644 (file)
 
 #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;
 }