mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 09:08:16 +02:00
test: Disable tests that are too slow to run by default.
Introduce a slow mode [-s] to the runner, and add "slow" to the requirements for the very long running tests like the coverage stress tests.
This commit is contained in:
parent
53139261c7
commit
299263f8c9
5 changed files with 32 additions and 19 deletions
|
|
@ -98,6 +98,7 @@ typedef struct _cairo_test_runner {
|
|||
cairo_bool_t list_only;
|
||||
cairo_bool_t full_test;
|
||||
cairo_bool_t keyword_match;
|
||||
cairo_bool_t slow;
|
||||
cairo_bool_t force_pass;
|
||||
} cairo_test_runner_t;
|
||||
|
||||
|
|
@ -321,7 +322,7 @@ static void
|
|||
usage (const char *argv0)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"Usage: %s [-afkxl] [test-names|keywords ...]\n"
|
||||
"Usage: %s [-afkxsl] [test-names|keywords ...]\n"
|
||||
" %s -l\n"
|
||||
"\n"
|
||||
"Run the cairo conformance test suite over the given tests (all by default)\n"
|
||||
|
|
@ -331,6 +332,7 @@ usage (const char *argv0)
|
|||
" skips similar surface and device offset testing.\n"
|
||||
" -f foreground; do not fork\n"
|
||||
" -k match tests by keyword\n"
|
||||
" -s include slow, long running tests\n"
|
||||
" -x exit on first failure\n"
|
||||
" -l list only; just list selected test case names without executing\n"
|
||||
"\n"
|
||||
|
|
@ -347,7 +349,7 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[])
|
|||
int c;
|
||||
|
||||
while (1) {
|
||||
c = _cairo_getopt (*argc, *argv, ":aflxt");
|
||||
c = _cairo_getopt (*argc, *argv, ":aflstx");
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
|
|
@ -355,6 +357,9 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[])
|
|||
case 'a':
|
||||
runner->full_test = TRUE;
|
||||
break;
|
||||
case 's':
|
||||
runner->slow = TRUE;
|
||||
break;
|
||||
case 'l':
|
||||
runner->list_only = TRUE;
|
||||
break;
|
||||
|
|
@ -790,6 +795,14 @@ main (int argc, char **argv)
|
|||
const char *requirements = test->requirements;
|
||||
const char *str;
|
||||
|
||||
str = strstr (requirements, "slow");
|
||||
if (str != NULL && ! runner.slow) {
|
||||
if (runner.list_only)
|
||||
goto TEST_NEXT;
|
||||
else
|
||||
goto TEST_SKIPPED;
|
||||
}
|
||||
|
||||
str = strstr (requirements, "cairo");
|
||||
if (str != NULL && ! _has_required_cairo_version (str)) {
|
||||
if (runner.list_only)
|
||||
|
|
|
|||
|
|
@ -335,38 +335,38 @@ row_triangles (cairo_t *cr, int width, int height)
|
|||
CAIRO_TEST (coverage_rectangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
NULL, /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, rectangles)
|
||||
|
||||
CAIRO_TEST (coverage_intersecting_quads,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
NULL, /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, intersecting_quads)
|
||||
|
||||
CAIRO_TEST (coverage_intersecting_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
NULL, /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, intersecting_triangles)
|
||||
CAIRO_TEST (coverage_row_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
NULL, /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, row_triangles)
|
||||
CAIRO_TEST (coverage_column_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
NULL, /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, column_triangles)
|
||||
CAIRO_TEST (coverage_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
NULL, /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, triangles)
|
||||
|
|
|
|||
|
|
@ -143,13 +143,13 @@ triangles (cairo_t *cr, int width, int height)
|
|||
CAIRO_TEST (half_coverage_rectangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
NULL, /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
WIDTH * SIZE, HEIGHT,
|
||||
NULL, rectangles)
|
||||
|
||||
CAIRO_TEST (half_coverage_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
NULL, /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
WIDTH * SIZE, HEIGHT,
|
||||
NULL, triangles)
|
||||
|
|
|
|||
|
|
@ -184,6 +184,6 @@ draw (cairo_t *cr, int width, int height)
|
|||
CAIRO_TEST (mask_glyphs,
|
||||
"Creates a mask using a distorted array of overlapping glyphs",
|
||||
"mask, glyphs", /* keywords */
|
||||
NULL, /* requirements */
|
||||
"slow", /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, draw)
|
||||
|
|
|
|||
|
|
@ -612,51 +612,51 @@ intersecting_triangles (cairo_t *cr, int width, int height)
|
|||
CAIRO_TEST (partial_coverage_rectangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
"coverage raster", /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
SIZE, SIZE,
|
||||
NULL, rectangles)
|
||||
|
||||
CAIRO_TEST (partial_coverage_intersecting_quads,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
"coverage raster", /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
SIZE, SIZE,
|
||||
NULL, intersecting_quads)
|
||||
|
||||
CAIRO_TEST (partial_coverage_intersecting_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
"coverage raster", /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
SIZE, SIZE,
|
||||
NULL, intersecting_triangles)
|
||||
CAIRO_TEST (partial_coverage_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
"coverage raster", /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
SIZE, SIZE,
|
||||
NULL, triangles)
|
||||
CAIRO_TEST (partial_coverage_overlap_three_quarter_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
"coverage raster", /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
SIZE, SIZE,
|
||||
NULL, overlap_three_quarter_triangles)
|
||||
CAIRO_TEST (partial_coverage_overlap_half_triangles_eo,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
"coverage raster", /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
SIZE, SIZE,
|
||||
NULL, overlap_half_triangles_eo)
|
||||
CAIRO_TEST (partial_coverage_overlap_half_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
"coverage raster", /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
SIZE, SIZE,
|
||||
NULL, overlap_half_triangles)
|
||||
CAIRO_TEST (partial_coverage_half_triangles,
|
||||
"Check the fidelity of the rasterisation.",
|
||||
"coverage raster", /* keywords */
|
||||
"target=raster", /* requirements */
|
||||
"target=raster slow", /* requirements */
|
||||
SIZE, SIZE,
|
||||
NULL, half_triangles)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue