summaryrefslogtreecommitdiff
path: root/test/cairo-test-runner.c
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/cairo-test-runner.c
parent53139261c7ba1a4cc0b869cb48c136b0362a3b0c (diff)
downloadcairo-299263f8c912d3468d51ed22bcb6ab96275709f0.tar.gz
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/cairo-test-runner.c')
-rw-r--r--test/cairo-test-runner.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index 0b0ac9c17..207ad6073 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)