This will enable regenerate functionality for those tests to make
developer lives easier while updating tests.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
tests/domainsnapshotxml2xmltest.c | 2 +-
tests/interfacexml2xmltest.c | 2 +-
tests/lxcconf2xmltest.c | 2 +-
tests/nodedevxml2xmltest.c | 2 +-
tests/qemuhotplugtest.c | 11 ++++++++---
5 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c
index cd91cfa..cf91447 100644
--- a/tests/domainsnapshotxml2xmltest.c
+++ b/tests/domainsnapshotxml2xmltest.c
@@ -114,7 +114,7 @@ testCompareXMLToXMLFiles(const char *inxml,
}
if (STRNEQ(outXmlData, actual)) {
- virtTestDifference(stderr, outXmlData, actual);
+ virtTestDifferenceFull(stderr, outXmlData, outxml, actual, inxml);
goto cleanup;
}
diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c
index 65f5167..ba34746 100644
--- a/tests/interfacexml2xmltest.c
+++ b/tests/interfacexml2xmltest.c
@@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *xml)
goto fail;
if (STRNEQ(xmlData, actual)) {
- virtTestDifference(stderr, xmlData, actual);
+ virtTestDifferenceFull(stderr, xmlData, xml, actual, NULL);
goto fail;
}
diff --git a/tests/lxcconf2xmltest.c b/tests/lxcconf2xmltest.c
index ed21e8a..fd5bc03 100644
--- a/tests/lxcconf2xmltest.c
+++ b/tests/lxcconf2xmltest.c
@@ -51,7 +51,7 @@ testCompareXMLToConfigFiles(const char *xml,
goto fail;
if (STRNEQ(expectxml, actualxml)) {
- virtTestDifference(stderr, expectxml, actualxml);
+ virtTestDifferenceFull(stderr, expectxml, xml, actualxml, NULL);
goto fail;
}
}
diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c
index a37d729..0089b5d 100644
--- a/tests/nodedevxml2xmltest.c
+++ b/tests/nodedevxml2xmltest.c
@@ -34,7 +34,7 @@ testCompareXMLToXMLFiles(const char *xml)
goto fail;
if (STRNEQ(xmlData, actual)) {
- virtTestDifference(stderr, xmlData, actual);
+ virtTestDifferenceFull(stderr, xmlData, xml, actual, NULL);
goto fail;
}
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 102e052..61ade25 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -175,6 +175,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm,
static int
testQemuHotplugCheckResult(virDomainObjPtr vm,
const char *expected,
+ const char *expectedFile,
bool fail)
{
char *actual;
@@ -192,7 +193,9 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
ret = 0;
} else {
if (!fail)
- virtTestDifference(stderr, expected, actual);
+ virtTestDifferenceFull(stderr,
+ expected, expectedFile,
+ actual, NULL);
ret = -1;
}
@@ -294,13 +297,15 @@ testQemuHotplug(const void *data)
VIR_FREE(dev);
}
if (ret == 0 || fail)
- ret = testQemuHotplugCheckResult(vm, result_xml, fail);
+ ret = testQemuHotplugCheckResult(vm, result_xml,
+ result_filename, fail);
break;
case DETACH:
ret = testQemuHotplugDetach(vm, dev);
if (ret == 0 || fail)
- ret = testQemuHotplugCheckResult(vm, domain_xml, fail);
+ ret = testQemuHotplugCheckResult(vm, domain_xml,
+ domain_filename, fail);
break;
case UPDATE:
--
2.7.0