Right now users need to know input file live inside
TEST_QEMU_CAPS_PATH, which is bad layering.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tests/qemucapabilitiestest.c | 5 +++--
tests/qemucaps2xmltest.c | 5 +++--
tests/testutilsqemu.c | 2 +-
tests/testutilsqemu.h | 3 ++-
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
index bb4ce74a29..6b8d2676e3 100644
--- a/tests/qemucapabilitiestest.c
+++ b/tests/qemucapabilitiestest.c
@@ -49,7 +49,6 @@ testQemuDataInit(testQemuDataPtr data)
if (qemuTestDriverInit(&data->driver) < 0)
return -1;
- data->inputDir = TEST_QEMU_CAPS_PATH;
data->outputDir = TEST_QEMU_CAPS_PATH;
data->ret = 0;
@@ -180,7 +179,8 @@ testQemuCapsCopy(const void *opaque)
static int
-doCapsTest(const char *base,
+doCapsTest(const char *inputDir,
+ const char *base,
const char *archName,
void *opaque)
{
@@ -193,6 +193,7 @@ doCapsTest(const char *base,
return -1;
}
+ data->inputDir = inputDir;
data->base = base;
data->archName = archName;
diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
index f5aecaa391..8985b20ac6 100644
--- a/tests/qemucaps2xmltest.c
+++ b/tests/qemucaps2xmltest.c
@@ -39,7 +39,6 @@ struct _testQemuData {
static int
testQemuDataInit(testQemuDataPtr data)
{
- data->inputDir = TEST_QEMU_CAPS_PATH;
data->outputDir = abs_srcdir "/qemucaps2xmloutdata";
data->ret = 0;
@@ -174,7 +173,8 @@ testQemuCapsXML(const void *opaque)
}
static int
-doCapsTest(const char *base,
+doCapsTest(const char *inputDir,
+ const char *base,
const char *archName,
void *opaque)
{
@@ -184,6 +184,7 @@ doCapsTest(const char *base,
if (virAsprintf(&title, "%s (%s)", base, archName) < 0)
return -1;
+ data->inputDir = inputDir;
data->base = base;
data->archName = archName;
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index c602255149..75c8180c7a 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -937,7 +937,7 @@ testQemuCapsIterate(const char *suffix,
archName++;
/* Run the user-provided callback */
- if (callback(base, archName, opaque) < 0)
+ if (callback(TEST_QEMU_CAPS_PATH, base, archName, opaque) < 0)
goto cleanup;
}
diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h
index a2f7bfcc26..07373f8ce6 100644
--- a/tests/testutilsqemu.h
+++ b/tests/testutilsqemu.h
@@ -96,7 +96,8 @@ char *testQemuGetLatestCapsForArch(const char *arch,
const char *suffix);
virHashTablePtr testQemuGetLatestCaps(void);
-typedef int (*testQemuCapsIterateCallback)(const char *base,
+typedef int (*testQemuCapsIterateCallback)(const char *inputDir,
+ const char *base,
const char *archName,
void *opaque);
int testQemuCapsIterate(const char *suffix,
--
2.21.0