summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-12 13:48:12 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-06-12 14:06:06 +0100
commit299263f8c912d3468d51ed22bcb6ab96275709f0 (patch)
treec6bbb38e06e65519b9f6cfe40009a845a4bc2e23 /test
parent53139261c7ba1a4cc0b869cb48c136b0362a3b0c (diff)
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.
Diffstat (limited to 'test')
-rw-r--r--test/cairo-test-runner.c17
-rw-r--r--test/coverage.c12
-rw-r--r--test/half-coverage.c4
-rw-r--r--test/mask-glyphs.c2
-rw-r--r--test/partial-coverage.c16
5 files changed, 32 insertions, 19 deletions
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index 0b0ac9c1..207ad607 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -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)
diff --git a/test/coverage.c b/test/coverage.c
index 198ebae8..d77b1e33 100644
--- a/test/coverage.c
+++ b/test/coverage.c
@@ -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)
diff --git a/test/half-coverage.c b/test/half-coverage.c
index 50f3b850..38cafda7 100644
--- a/test/half-coverage.c
+++ b/test/half-coverage.c
@@ -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)
diff --git a/test/mask-glyphs.c b/test/mask-glyphs.c
index 1a76c4e5..0a912e17 100644
--- a/test/mask-glyphs.c
+++ b/test/mask-glyphs.c
@@ -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)
diff --git a/test/partial-coverage.c b/test/partial-coverage.c
index ae0ee1ed..0b5cbdcb 100644
--- a/test/partial-coverage.c
+++ b/test/partial-coverage.c
@@ -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)