[PATCH rendercheck] Report results on a per-test basis
Martin Peres
martin.peres at linux.intel.com
Thu Oct 6 14:05:35 UTC 2016
This allows a runner such as EzBench to track each test individually
and not limit the resolution to groups.
This feature can be triggered by using the -r parameter.
Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
---
main.c | 12 ++++++----
rendercheck.h | 4 ++--
tests.c | 70 +++++++++++++++++++++++++++++++++++++++++------------------
3 files changed, 59 insertions(+), 27 deletions(-)
diff --git a/main.c b/main.c
index 0d3d146..e7f6e09 100644
--- a/main.c
+++ b/main.c
@@ -27,7 +27,7 @@
#include <strings.h>
#include <getopt.h>
-bool is_verbose = false, minimalrendering = false;
+bool is_verbose = false, minimalrendering = false, enable_report = false;
int enabled_tests = ~0; /* Enable all tests by default */
int format_whitelist_len = 0;
@@ -163,7 +163,7 @@ usage (char *program)
{
fprintf(stderr, "usage: %s [-d|--display display] [-v|--verbose]\n"
"\t[-t test1,test2,...] [-o op1,op2,...] [-f format1,format2,...]\n"
- "\t[--sync] [--minimalrendering] [--version]\n"
+ "\t[--sync] [--minimalrendering] [--report] [--version]\n"
"Available tests:\n", program);
print_tests(stderr, ~0);
exit(1);
@@ -189,6 +189,7 @@ int main(int argc, char **argv)
{ "tests", required_argument, NULL, 't' },
{ "ops", required_argument, NULL, 'o' },
{ "verbose", no_argument, NULL, 'v' },
+ { "report", no_argument, NULL, 'r' },
{ "sync", no_argument, &is_sync, true},
{ "minimalrendering", no_argument,
&longopt_minimalrendering, true},
@@ -196,7 +197,7 @@ int main(int argc, char **argv)
{ NULL, 0, NULL, 0 }
};
- while ((o = getopt_long(argc, argv, "d:i:f:t:o:v", longopts, NULL)) != -1) {
+ while ((o = getopt_long(argc, argv, "d:i:f:t:o:rv", longopts, NULL)) != -1) {
switch (o) {
case 'd':
display = optarg;
@@ -276,6 +277,9 @@ int main(int argc, char **argv)
case 'v':
is_verbose = true;
break;
+ case 'r':
+ enable_report = true;
+ break;
case 0:
break;
default:
@@ -345,7 +349,7 @@ int main(int argc, char **argv)
while (XNextEvent(dpy, &ev) == 0) {
if (ev.type == Expose && !ev.xexpose.count) {
- if (do_tests(dpy, &window))
+ if (do_tests(dpy, &window, enable_report))
ret = 0;
else
ret = 1;
diff --git a/rendercheck.h b/rendercheck.h
index 1c392e8..43d6f2b 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -132,7 +132,7 @@ extern struct rendercheck_test __start_test_section, __stop_test_section;
extern int pixmap_move_iter;
extern int win_width, win_height;
extern struct op_info ops[];
-extern bool is_verbose, minimalrendering;
+extern bool is_verbose, minimalrendering, enable_report;
extern color4d colors[];
extern int enabled_tests;
extern int format_whitelist_len;
@@ -193,7 +193,7 @@ argb_fill(Display *dpy, picture_info *p, int x, int y, int w, int h, float a,
float r, float g, float b);
bool
-do_tests(Display *dpy, picture_info *win);
+do_tests(Display *dpy, picture_info *win, bool enable_report);
void
copy_pict_to_win(Display *dpy, picture_info *pict, picture_info *win,
diff --git a/tests.c b/tests.c
index 22cbfd4..253461c 100644
--- a/tests.c
+++ b/tests.c
@@ -315,7 +315,7 @@ create_formats_list(Display *dpy)
}
bool
-do_tests(Display *dpy, picture_info *win)
+do_tests(Display *dpy, picture_info *win, bool enable_report)
{
int i, j, src;
int num_dests;
@@ -436,6 +436,14 @@ do { \
tests_total++; \
} while (0)
+#define REPORT_RESULTS(fmt, ...) \
+do { \
+ RECORD_RESULTS(); \
+ if (enable_report) \
+ fprintf(stderr, "## " fmt ": %s\n", \
+ ##__VA_ARGS__, ok ? "pass" : "fail"); \
+} while (0)
+
num_tests = num_colors * nformats;
test_ops = malloc(sizeof(int)*num_ops);
@@ -482,13 +490,23 @@ do { \
printf("Beginning testing of filling of 1x1R pictures\n");
for (i = 0; i < num_tests; i++) {
ok = fill_test(dpy, win, &pictures_1x1[i]);
- RECORD_RESULTS();
+ REPORT_RESULTS("fill 1x1R src=(%s, %.2f:%.2f:%.2f:%.2f)",
+ pictures_1x1[i].name,
+ pictures_1x1[i].color.a,
+ pictures_1x1[i].color.r,
+ pictures_1x1[i].color.g,
+ pictures_1x1[i].color.b);
}
printf("Beginning testing of filling of 10x10 pictures\n");
for (i = 0; i < num_tests; i++) {
ok = fill_test(dpy, win, &pictures_10x10[i]);
- RECORD_RESULTS();
+ REPORT_RESULTS("fill 10x10 src=(%s, %.2f:%.2f:%.2f:%.2f)",
+ pictures_1x1[i].name,
+ pictures_1x1[i].color.a,
+ pictures_1x1[i].color.r,
+ pictures_1x1[i].color.g,
+ pictures_1x1[i].color.b);
}
if (group_ok)
success_mask |= TEST_FILL;
@@ -502,7 +520,8 @@ do { \
ok = dstcoords_test(dpy, win,
i == 0 ? PictOpSrc : PictOpOver, win,
argb32white, argb32red);
- RECORD_RESULTS();
+ REPORT_RESULTS("dst coords %s",
+ i == 0 ? "PictOpSrc" : "PictOpOver");
}
if (group_ok)
success_mask |= TEST_DSTCOORDS;
@@ -513,7 +532,8 @@ do { \
printf("Beginning src coords test\n");
ok = srccoords_test(dpy, win, argb32white, false);
- RECORD_RESULTS();
+ REPORT_RESULTS("src coords");
+
if (group_ok)
success_mask |= TEST_SRCCOORDS;
}
@@ -523,7 +543,8 @@ do { \
printf("Beginning mask coords test\n");
ok = srccoords_test(dpy, win, argb32white, true);
- RECORD_RESULTS();
+ REPORT_RESULTS("mask coords");
+
if (group_ok)
success_mask |= TEST_MASKCOORDS;
}
@@ -533,11 +554,12 @@ do { \
printf("Beginning transformed src coords test\n");
ok = trans_coords_test(dpy, win, argb32white, false);
- RECORD_RESULTS();
+ REPORT_RESULTS("transform src coord");
printf("Beginning transformed src coords test 2\n");
ok = trans_srccoords_test_2(dpy, win, argb32white, false);
- RECORD_RESULTS();
+ REPORT_RESULTS("transform src coord2");
+
if (group_ok)
success_mask |= TEST_TSRCCOORDS;
}
@@ -547,11 +569,11 @@ do { \
printf("Beginning transformed mask coords test\n");
ok = trans_coords_test(dpy, win, argb32white, true);
- RECORD_RESULTS();
+ REPORT_RESULTS("transform mask coord");
printf("Beginning transformed mask coords test 2\n");
ok = trans_srccoords_test_2(dpy, win, argb32white, true);
- RECORD_RESULTS();
+ REPORT_RESULTS("transform mask coord2");
if (group_ok)
success_mask |= TEST_TMASKCOORDS;
@@ -574,7 +596,7 @@ do { \
test_ops, num_test_ops,
test_src, num_test_src,
test_dst, num_test_dst);
- RECORD_RESULTS();
+ REPORT_RESULTS("blend %s", pi->name);
}
if (group_ok)
success_mask |= TEST_BLEND;
@@ -599,7 +621,7 @@ do { \
test_mask, num_test_mask,
test_dst, num_test_dst,
false);
- RECORD_RESULTS();
+ REPORT_RESULTS("composite mask %s", pi->name);
}
if (group_ok)
success_mask |= TEST_COMPOSITE;
@@ -624,7 +646,7 @@ do { \
test_mask, num_test_mask,
test_dst, num_test_dst,
true);
- RECORD_RESULTS();
+ REPORT_RESULTS("composite CA mask %s", pi->name);
}
if (group_ok)
success_mask |= TEST_CACOMPOSITE;
@@ -635,7 +657,10 @@ do { \
printf("Beginning render to linear gradient test\n");
ok = render_to_gradient_test(dpy, &pictures_1x1[0]);
- RECORD_RESULTS();
+ REPORT_RESULTS("render linear gradient %s - color %.2f:%.2f:%.2f:%.2f",
+ pictures_1x1[0].name, pictures_1x1[0].color.a,
+ pictures_1x1[0].color.r, pictures_1x1[0].color.g,
+ pictures_1x1[0].color.b);
for (i = 0; i < num_ops; i++) {
if (ops[i].disabled)
@@ -654,7 +679,10 @@ do { \
for (src = 0; src < num_tests; src++) {
ok = linear_gradient_test(dpy, win, pi, i,
&pictures_1x1[src]);
- RECORD_RESULTS();
+ REPORT_RESULTS("%s linear gradient dst=%s, src=(%s, %.2f:%.2f:%.2f:%.2f)",
+ ops[i].name, pi->name, pictures_1x1[src].name,
+ pictures_1x1[src].color.a, pictures_1x1[src].color.r,
+ pictures_1x1[src].color.g, pictures_1x1[src].color.b);
}
}
}
@@ -683,7 +711,7 @@ do { \
*/
ok = repeat_test(dpy, win, pi, i, argb32white, argb32red,
argb32green, false);
- RECORD_RESULTS();
+ REPORT_RESULTS("%s src repeat %s", ops[i].name, pi->name);
printf("Beginning %s mask repeat test on %s\n",
ops[i].name, pi->name);
@@ -692,7 +720,7 @@ do { \
*/
ok = repeat_test(dpy, win, pi, i, argb32white, argb32red,
argb32green, true);
- RECORD_RESULTS();
+ REPORT_RESULTS("%s mask repeat %s", ops[i].name, pi->name);
}
}
if (group_ok)
@@ -718,19 +746,19 @@ do { \
ops[i].name, pi->name);
ok = triangles_test(dpy, win, pi, i,
argb32red, argb32white);
- RECORD_RESULTS();
+ REPORT_RESULTS("%s Triangles %s", ops[i].name, pi->name);
printf("Beginning %s TriStrip test on %s\n",
ops[i].name, pi->name);
ok = tristrip_test(dpy, win, pi, i,
argb32red, argb32white);
- RECORD_RESULTS();
+ REPORT_RESULTS("%s TriStrip %s", ops[i].name, pi->name);
printf("Beginning %s TriFan test on %s\n",
ops[i].name, pi->name);
ok = trifan_test(dpy, win, pi, i,
argb32red, argb32white);
- RECORD_RESULTS();
+ REPORT_RESULTS("%s TriFan %s", ops[i].name, pi->name);
}
}
if (group_ok)
@@ -741,7 +769,7 @@ do { \
bool ok, group_ok = true;
ok = bug7366_test(dpy);
- RECORD_RESULTS();
+ REPORT_RESULTS("bug7366");
if (group_ok)
success_mask |= TEST_BUG7366;
--
2.10.0
More information about the xorg-devel
mailing list