[kvm-unit-tests PATCH] lib: Do not report failures when test passes

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

 



From: Nadav Amit <nadav.amit@xxxxxxxxx>

Currently, if a test is expected to fail, but surprisingly it passes,
the test is considered as "failing". This means that running on old
KVM-unit-tests on new KVM versions can falsely report failures.

Fix it and simplify the logic.

Signed-off-by: Nadav Amit <nadav.amit@xxxxxxxxx>
---
 lib/report.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/report.c b/lib/report.c
index ca9b4fd..8c8db14 100644
--- a/lib/report.c
+++ b/lib/report.c
@@ -96,10 +96,12 @@ static void va_report(const char *msg_fmt,
 	puts("\n");
 	if (skip)
 		skipped++;
-	else if (xfail && !pass)
-		xfailures++;
-	else if (xfail || !pass)
-		failures++;
+	else if (!pass) {
+		if (xfail)
+			xfailures++;
+		else
+			failures++;
+	}
 
 	spin_unlock(&lock);
 }
-- 
2.17.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux