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:
Pavel Hrdina 2015-12-10 15:20:56 +01:00
parent 781d70c027
commit c060f44c16
1 changed files with 3 additions and 7 deletions

View File

@ -670,16 +670,12 @@ virtTestCompareToFile(const char *strcontent,
if (STRNEQ_NULLABLE(fixedcontent ? fixedcontent : strcontent,
filecontent)) {
if (virTestGetRegenerate()) {
if (virFileWriteStr(filename, strcontent, 0666) < 0)
goto failure;
goto out;
}
virtTestDifference(stderr, filecontent, strcontent);
virtTestDifferenceFull(stderr,
filecontent, filename,
strcontent, NULL);
goto failure;
}
out:
ret = 0;
failure:
VIR_FREE(fixedcontent);