[Piglit] [PATCH 2/2] xts: Add a set of rendercheck tests to run.

Eric Anholt eric at anholt.net
Wed Jul 8 14:38:51 PDT 2015


We don't do a full run, because that takes approximately an eternity.
However, running a small subset can be useful to catch certain bugs in
Render implementations.  This passes on an fb implementation in <4
seconds on my laptop.
---
 tests/xts-render.py |  4 ++++
 tests/xts.py        | 55 +++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/tests/xts-render.py b/tests/xts-render.py
index c9adece..aba87f0 100644
--- a/tests/xts-render.py
+++ b/tests/xts-render.py
@@ -23,6 +23,10 @@ from framework import core
 from framework.profile import load_test_profile
 
 def xts_render_filter(path, test):
+    # Keep any tests that aren't from xts.
+    if 'xts5' not in path:
+        return True
+
     # All of Xlib9 is for rendering.
     return 'xlib9' in path
 
diff --git a/tests/xts.py b/tests/xts.py
index d9e3a3e..c8c8717 100644
--- a/tests/xts.py
+++ b/tests/xts.py
@@ -160,11 +160,20 @@ class XTSTest(Test):  # pylint: disable=too-few-public-methods
 
         self.result['images'] = self._process_log_for_images(log)
 
+class RendercheckTest(Test):
+    def __init__(self, args):
+        super(RendercheckTest, self).__init__(['rendercheck'] + args)
+        self.testname = "rendercheck " + " ".join(args)
 
-def _populate_profile():
-    """ Populate the profile attribute """
-    # Add all tests to the profile
-    profile = XTSProfile()  # pylint: disable=redefined-outer-name
+    def interpret_result(self):
+        if self.result['returncode'] == 0:
+            self.result['result'] = 'pass'
+        elif self.result['returncode'] == 77:
+            self.result['result'] = 'skip'
+        else:
+            self.result['result'] = 'fail'
+
+def populate_profile_xts(profile):
     fpath = os.path.join(X_TEST_SUITE, 'xts5')
     for dirpath, _, filenames in os.walk(fpath):
         for fname in filenames:
@@ -192,6 +201,44 @@ def _populate_profile():
                             os.path.join(dirpath, testname),
                             testname,
                             num)
+
+def add_rendercheck_test(profile, path, args):
+    path = 'rendercheck/' + path
+    test = RendercheckTest(args.split(' '))
+    group = grouptools.join(grouptools.from_path(path))
+    profile.test_list[group] = test
+
+def populate_profile_rendercheck(profile):
+    add_rendercheck_test(profile, 'blend/All/a8r8g8b8', '-t blend -f a8r8g8b8')
+    add_rendercheck_test(profile, 'blend/All/x8r8g8b8', '-t blend -f a8r8g8b8,x8r8g8b8')
+    add_rendercheck_test(profile, 'blend/All/a2r10g10b10', '-t blend -f a8r8g8b8,a2r10g10b10')
+    add_rendercheck_test(profile, 'blend/Clear', '-t blend -o clear')
+    add_rendercheck_test(profile, 'blend/Src', '-t blend -o src')
+    add_rendercheck_test(profile, 'blend/Over', '-t blend -o over')
+    add_rendercheck_test(profile, 'composite/All/a8r8g8b8', '-t composite -f a8r8g8b8')
+    add_rendercheck_test(profile, 'composite/All/x8r8g8b8', '-t composite -f a8r8g8b8,x8r8g8b8')
+    add_rendercheck_test(profile, 'composite/All/a2r10g10b10', '-t composite -f a8r8g8b8,a2r10g10b10')
+    add_rendercheck_test(profile, 'ca composite/All/a8r8g8b8', '-t cacomposite -f a8r8g8b8')
+    add_rendercheck_test(profile, 'ca composite/All/x8r8g8b8', '-t cacomposite -f a8r8g8b8,x8r8g8b8')
+    add_rendercheck_test(profile, 'ca composite/All/a2r10g10b10', '-t cacomposite -f a8r8g8b8,a2r10g10b10')
+    add_rendercheck_test(profile, 'fill', '-t fill')
+    add_rendercheck_test(profile, 'bug7366', '-t bug7366')
+    add_rendercheck_test(profile, 'destination coordinates', '-t dcoords')
+    add_rendercheck_test(profile, 'source coordinates', '-t scoords')
+    add_rendercheck_test(profile, 'mask coordinates', '-t mcoords')
+    add_rendercheck_test(profile, 'translated source coordinates', '-t tscoords')
+    add_rendercheck_test(profile, 'translated mask coordinates', '-t tmcoords')
+    add_rendercheck_test(profile, 'triangles', '-t triangles')
+    add_rendercheck_test(profile, 'LibreOffice xRGB', '-t libreoffice_xrgb')
+    add_rendercheck_test(profile, 'GTK ARGB vs xBGR', '-t gtk_argb_xbgr')
+    add_rendercheck_test(profile, 'large blend source', '-t large_blend_src')
+
+def _populate_profile():
+    """ Populate the profile attribute """
+    # Add all tests to the profile
+    profile = XTSProfile()  # pylint: disable=redefined-outer-name
+    populate_profile_xts(profile)
+    populate_profile_rendercheck(profile)
     return profile
 
 
-- 
2.1.4



More information about the Piglit mailing list