From 2cbc0164b07a9abf5f88a898954bd81cdeebae82 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Wed, 6 Nov 2013 14:42:17 +0100 Subject: [PATCH] tests: Fix virtpcitest in VPATH --- tests/virpcimock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 9d5c079ea9..19062c3705 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -305,9 +305,14 @@ pci_device_new_from_stub(const struct pciDevice *data) char *configSrc, *configDst; char tmp[32]; struct stat sb; + char *abs_srcdir; + + abs_srcdir = getenv("abs_srcdir"); + if (!abs_srcdir) + abs_srcdir = getcwd(NULL, 0); if (VIR_ALLOC_QUIET(dev) < 0 || - virAsprintfQuiet(&configSrc, "%s/virpcitestdata/%s.config", abs_builddir, data->id) < 0 || + virAsprintfQuiet(&configSrc, "%s/virpcitestdata/%s.config", abs_srcdir, data->id) < 0 || virAsprintfQuiet(&devpath, "%s/devices/%s", fakesysfsdir, data->id) < 0) ABORT_OOM(); -- GitLab