[PATCH 3/3] tests: formats: Improve error reporting

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

 



Improve the formats test by counting the number of formats that failed
and reporting failures appropriately.

Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
---
 tests/kms-test-formats.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/kms-test-formats.py b/tests/kms-test-formats.py
index 93075561a843..86f16511f1ea 100755
--- a/tests/kms-test-formats.py
+++ b/tests/kms-test-formats.py
@@ -40,6 +40,8 @@ class FormatsTest(kmstest.KMSTest):
         self.logger.log("Testing connector %s, CRTC %u, mode %s" % \
               (connector.fullname, crtc.id, mode.name))
 
+        failed = 0
+
         num_formats = len(crtc.primary_plane.formats)
         for i in range(num_formats):
             format = crtc.primary_plane.formats[i]
@@ -51,6 +53,8 @@ class FormatsTest(kmstest.KMSTest):
             try:
                 fb = pykms.DumbFramebuffer(self.card, mode.hdisplay, mode.vdisplay, format)
             except ValueError:
+                self.logger.log("Failed to create frame buffer")
+                failed += 1
                 continue
 
             pykms.draw_test_pattern(fb)
@@ -58,12 +62,17 @@ class FormatsTest(kmstest.KMSTest):
             # Set the mode with a primary plane
             ret = self.atomic_crtc_mode_set(crtc, connector, mode, fb)
             if ret < 0:
-                self.fail("atomic mode set failed with %d" % ret)
+                self.logger.log("atomic mode set failed with %d" % ret)
+                failed += 1
                 continue
 
             self.run(3)
 
         self.atomic_crtc_disable(crtc)
-        self.success()
+
+        if failed:
+            self.fail("%s/%s formats failed" % (failed, num_formats))
+        else:
+            self.success()
 
 FormatsTest().execute()
-- 
Regards,

Laurent Pinchart





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux