diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-03 15:20:05 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-05 16:08:20 +0100 |
commit | 5f70148467ff2767dc3c6d45f4af1223d7daa301 (patch) | |
tree | 9538e6238d245fdd598b246cda82d2b3ada05d72 | |
parent | 690c61aa54c27e4d35b04d0173abd5931fce507d (diff) |
test: Allow CAIRO_TEST_MODE to independently enable extended testing
Such as CAIRO_TEST_MODE=scale for testing application of
cairo_surface_set_device_offset.
CAIRO_TEST_MODE=similar - test rendering through similar surfaces
CAIRO_TEST_MODE=offset - test rendering with a device offset
CAIRO_TEST_MODE=scale - test rendering with a device scale
-rw-r--r-- | test/cairo-test-runner.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c index 71107f3c6..3fb3ae5c0 100644 --- a/test/cairo-test-runner.c +++ b/test/cairo-test-runner.c @@ -358,7 +358,7 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[]) switch (c) { case 'a': - runner->full_test = TRUE; + runner->full_test = ~0; break; case 'f': runner->foreground = TRUE; @@ -691,6 +691,9 @@ _has_required_rsvg_version (const char *str) return TRUE; } +#define TEST_SIMILAR 0x1 +#define TEST_OFFSET 0x2 +#define TEST_SCALE 0x4 int main (int argc, char **argv) { @@ -722,7 +725,16 @@ main (int argc, char **argv) const char *env = getenv ("CAIRO_TEST_MODE"); if (strstr (env, "full")) { - runner.full_test = TRUE; + runner.full_test = ~0; + } + if (strstr (env, "similar")) { + runner.full_test |= TEST_SIMILAR; + } + if (strstr (env, "offset")) { + runner.full_test |= TEST_OFFSET; + } + if (strstr (env, "scale")) { + runner.full_test |= TEST_SCALE; } if (strstr (env, "foreground")) { runner.foreground = TRUE; @@ -743,8 +755,10 @@ main (int argc, char **argv) cairo_tests_env = getenv("CAIRO_TESTS"); append_argv (&argc, &argv, cairo_tests_env); - if (runner.full_test) { + if (runner.full_test & TEST_OFFSET) { runner.num_device_offsets = 2; + } + if (runner.full_test & TEST_SCALE) { runner.num_device_scales = 2; } @@ -910,7 +924,7 @@ main (int argc, char **argv) target = ctx.targets_to_test[n]; - has_similar = runner.full_test ? + has_similar = runner.full_test & TEST_SIMILAR ? cairo_test_target_has_similar (&ctx, target) : DIRECT; for (m = 0; m < runner.num_device_offsets; m++) { |