diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-01-10 13:04:52 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-08-13 21:55:09 +0100 |
commit | f85a4aec1f94f8fbd8e4db770ff1f70c3286fc90 (patch) | |
tree | 046aa588f02008f66abd5680a658d1489bd11fd1 /test/create-for-stream.c | |
parent | 436c0c8be28546813139f391a62303d4c1894fc3 (diff) | |
download | cairo-f85a4aec1f94f8fbd8e4db770ff1f70c3286fc90.tar.gz |
[test] Export a function to check whether a target is enabled.
Allow individuals tests to check whether a test target is enabled -
useful for those tests that circumvent cairo_test() and perform
feature testing.
Diffstat (limited to 'test/create-for-stream.c')
-rw-r--r-- | test/create-for-stream.c | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/test/create-for-stream.c b/test/create-for-stream.c index 9d90cf4ef..211d2c4a3 100644 --- a/test/create-for-stream.c +++ b/test/create-for-stream.c @@ -243,36 +243,42 @@ main (void) cairo_test_init (&ctx, test_name); #if CAIRO_HAS_PS_SURFACE - test_status = test_surface (&ctx, "ps", "create-for-stream.ps", - cairo_ps_surface_create, - cairo_ps_surface_create_for_stream); - cairo_test_log (&ctx, "TEST: %s TARGET: %s RESULT: %s\n", - test_name, "ps", - test_status ? "FAIL" : "PASS"); - if (status == CAIRO_TEST_SUCCESS) - status = test_status; + if (cairo_test_is_target_enabled (&ctx, "ps")) { + test_status = test_surface (&ctx, "ps", "create-for-stream.ps", + cairo_ps_surface_create, + cairo_ps_surface_create_for_stream); + cairo_test_log (&ctx, "TEST: %s TARGET: %s RESULT: %s\n", + test_name, "ps", + test_status ? "FAIL" : "PASS"); + if (status == CAIRO_TEST_SUCCESS) + status = test_status; + } #endif #if CAIRO_HAS_PDF_SURFACE - test_status = test_surface (&ctx, "pdf", "create-for-stream.pdf", - cairo_pdf_surface_create, - cairo_pdf_surface_create_for_stream); - cairo_test_log (&ctx, "TEST: %s TARGET: %s RESULT: %s\n", - test_name, "pdf", - test_status ? "FAIL" : "PASS"); - if (status == CAIRO_TEST_SUCCESS) - status = test_status; + if (cairo_test_is_target_enabled (&ctx, "pdf")) { + test_status = test_surface (&ctx, "pdf", "create-for-stream.pdf", + cairo_pdf_surface_create, + cairo_pdf_surface_create_for_stream); + cairo_test_log (&ctx, "TEST: %s TARGET: %s RESULT: %s\n", + test_name, "pdf", + test_status ? "FAIL" : "PASS"); + if (status == CAIRO_TEST_SUCCESS) + status = test_status; + } #endif #if CAIRO_HAS_SVG_SURFACE - test_status = test_surface (&ctx, "svg", "create-for-stream.svg", - cairo_svg_surface_create, - cairo_svg_surface_create_for_stream); - cairo_test_log (&ctx, "TEST: %s TARGET: %s RESULT: %s\n", - test_name, "svg", - test_status ? "FAIL" : "PASS"); - if (status == CAIRO_TEST_SUCCESS) - status = test_status; + if (cairo_test_is_target_enabled (&ctx, "svg")) { + test_status = test_surface (&ctx, "svg", "create-for-stream.svg", + cairo_svg_surface_create, + cairo_svg_surface_create_for_stream); + cairo_test_log (&ctx, "TEST: %s TARGET: %s RESULT: %s\n", + test_name, "svg", + test_status ? "FAIL" : "PASS"); + if (status == CAIRO_TEST_SUCCESS) + status = test_status; + } #endif cairo_test_fini (&ctx); |