mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests.testutils: use virTestDifferenceFull in virtTestCompareToFile
Let's use the new virTestDifferenceFull function that will regenerate the expected output and fail the test to let developer know that there something was updated. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
781d70c027
commit
c060f44c16
@ -670,16 +670,12 @@ virtTestCompareToFile(const char *strcontent,
|
|||||||
|
|
||||||
if (STRNEQ_NULLABLE(fixedcontent ? fixedcontent : strcontent,
|
if (STRNEQ_NULLABLE(fixedcontent ? fixedcontent : strcontent,
|
||||||
filecontent)) {
|
filecontent)) {
|
||||||
if (virTestGetRegenerate()) {
|
virtTestDifferenceFull(stderr,
|
||||||
if (virFileWriteStr(filename, strcontent, 0666) < 0)
|
filecontent, filename,
|
||||||
goto failure;
|
strcontent, NULL);
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
virtTestDifference(stderr, filecontent, strcontent);
|
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
failure:
|
failure:
|
||||||
VIR_FREE(fixedcontent);
|
VIR_FREE(fixedcontent);
|
||||||
|
Loading…
Reference in New Issue
Block a user