diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-06-10 11:56:39 +0300 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-07-06 12:04:12 +0300 |
commit | a33c2e6853fe0a76da42a43ed7ed9095e2dbe6a2 (patch) | |
tree | 9912e541ef39472897757f22df74b89fb9efd7b5 | |
parent | 3ac7ae201758fe99627fdb2adf783be4063a9b1f (diff) |
lowlevel-blt-bench: print single pattern details
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@collabora.co.uk>
Reviewed-by: Ben Avison <bavison@riscosopen.org>
-rw-r--r-- | test/lowlevel-blt-bench.c | 28 |
1 files 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); |