[Pixman] [PATCH 4/9] lowlevel-blt-bench: print single pattern details

Pekka Paalanen ppaalanen at gmail.com
Wed Jun 10 06:32:53 PDT 2015


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

When given just a single test pattern instead of "all", print the test
details. This can be used to verify the pattern parser agrees with the
user, just like scaling settings are printed.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 test/lowlevel-blt-bench.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c
index 866dedd..aca1819 100644
--- a/test/lowlevel-blt-bench.c
+++ b/test/lowlevel-blt-bench.c
@@ -822,6 +822,8 @@ parse_test_pattern (test_entry_t *test, const char *pattern)
         }
     }
 
+    test->testname = pattern;
+
     /* Extract operator, may contain delimiters,
      * so take the longest string that matches.
      */
@@ -947,7 +949,21 @@ parser_self_test (void)
 }
 
 static void
-run_one_test (const char *pattern, double bandwidth_)
+print_test_details (const test_entry_t *test)
+{
+    printf ("%s: %s, src %s%s, mask %s%s%s, dst %s\n",
+            test->testname,
+            operator_name (test->op),
+            format_name (test->src_fmt),
+            test->src_flags & SOLID_FLAG ? " solid" : "",
+            format_name (test->mask_fmt),
+            test->mask_flags & SOLID_FLAG ? " solid" : "",
+            test->mask_flags & CA_FLAG ? " CA" : "",
+            format_name (test->dst_fmt));
+}
+
+static void
+run_one_test (const char *pattern, double bandwidth_, pixman_bool_t prdetails)
 {
     test_entry_t test;
 
@@ -957,6 +973,12 @@ run_one_test (const char *pattern, double bandwidth_)
         return;
     }
 
+    if (prdetails)
+    {
+        print_test_details (&test);
+        printf ("---\n");
+    }
+
     bench_composite (pattern,
                      test.src_fmt,
                      test.src_flags,
@@ -973,7 +995,7 @@ run_default_tests (double bandwidth_)
     int i;
 
     for (i = 0; i < ARRAY_LENGTH (tests_tbl); i++)
-        run_one_test (tests_tbl[i].testname, bandwidth_);
+        run_one_test (tests_tbl[i].testname, bandwidth_, FALSE);
 }
 
 static void
@@ -1078,7 +1100,7 @@ main (int argc, char *argv[])
     }
     else
     {
-        run_one_test (pattern, bandwidth);
+        run_one_test (pattern, bandwidth, TRUE);
     }
 
     free (src);
-- 
2.3.6



More information about the Pixman mailing list