[PATCH 04/10] tests.testutils: use virTestDifferenceFull in virtTestCompareToFile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/testutils.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/tests/testutils.c b/tests/testutils.c
index 70e3456..6645d61 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -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);
-- 
2.7.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]