mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 08:48:00 +02:00
[perf] Check output
Add a CAIRO_PERF_OUTPUT environment variable to cause cairo-perf to first generate an output image in order to manually check that the test is functioning correctly. This needs to be automated, so that we have absolute confidence that the performance tests are not broken - but isn't that the role of the test suite? If we were ever to publish cairo-perf results, I would want some means of verification that the test-suite had first been passed.
This commit is contained in:
parent
8c6ecfe648
commit
229887e980
1 changed files with 19 additions and 0 deletions
|
|
@ -200,6 +200,25 @@ cairo_perf_run (cairo_perf_t *perf,
|
|||
|
||||
times = perf->times;
|
||||
|
||||
if (getenv ("CAIRO_PERF_OUTPUT") != NULL) { /* check output */
|
||||
char *filename;
|
||||
cairo_status_t status;
|
||||
|
||||
xasprintf (&filename, "%s.%s.%s.%d.out.png",
|
||||
name, perf->target->name,
|
||||
_content_to_string (perf->target->content, 0),
|
||||
perf->size);
|
||||
perf_func (perf->cr, perf->size, perf->size);
|
||||
status = cairo_surface_write_to_png (cairo_get_target (perf->cr), filename);
|
||||
if (status) {
|
||||
fprintf (stderr, "Failed to generate output check '%s': %s\n",
|
||||
filename, cairo_status_to_string (status));
|
||||
return;
|
||||
}
|
||||
|
||||
free (filename);
|
||||
}
|
||||
|
||||
has_similar = cairo_perf_has_similar (perf);
|
||||
for (similar = 0; similar <= has_similar; similar++) {
|
||||
if (perf->summary) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue