summaryrefslogtreecommitdiff
path: root/test/pattern-get-type.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-09-03 16:38:03 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-31 12:30:11 +0000
commite90073f7ddc6f461a935bc360c409b04f1fe9f74 (patch)
treeefda94d1ecd13143cdad23f14552661165e7601e /test/pattern-get-type.c
parent8457972d40088cda165f31fdd7bd9b4c19c6e095 (diff)
downloadcairo-e90073f7ddc6f461a935bc360c409b04f1fe9f74.tar.gz
[test] Build test suite into single binary.
Avoid calling libtool to link every single test case, by building just one binary from all the sources. This binary is then given the task of choosing tests to run (based on user selection and individual test requirement), forking each test into its own process and accumulating the results.
Diffstat (limited to 'test/pattern-get-type.c')
-rw-r--r--test/pattern-get-type.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/test/pattern-get-type.c b/test/pattern-get-type.c
index 96ed0c947..d2ef5bf34 100644
--- a/test/pattern-get-type.c
+++ b/test/pattern-get-type.c
@@ -25,17 +25,13 @@
#include "cairo-test.h"
-int
-main (void)
+static cairo_test_status_t
+preamble (cairo_test_context_t *Ctx)
{
- cairo_test_context_t ctx;
cairo_surface_t *surface;
cairo_pattern_t *solid_rgb, *solid_rgba, *surface_pattern, *linear, *radial;
cairo_test_status_t result = CAIRO_TEST_SUCCESS;
- cairo_test_init (&ctx, "pattern-get-type");
- cairo_test_log (&ctx, "Creating patterns of all types\n");
-
solid_rgb = cairo_pattern_create_rgb (0.0, 0.1, 0.2);
solid_rgba = cairo_pattern_create_rgba (0.3, 0.4, 0.5, 0.6);
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
@@ -45,8 +41,6 @@ main (void)
radial = cairo_pattern_create_radial (10.0, 10.0, 0.1,
10.0, 10.0, 1.0);
- cairo_test_log (&ctx, "Verifying return values of cairo_pattern_get_type\n");
-
if (cairo_pattern_get_type (solid_rgb) != CAIRO_PATTERN_TYPE_SOLID)
result = CAIRO_TEST_FAILURE;
@@ -62,8 +56,6 @@ main (void)
if (cairo_pattern_get_type (radial) != CAIRO_PATTERN_TYPE_RADIAL)
result = CAIRO_TEST_FAILURE;
- cairo_test_log (&ctx, "Cleaning up\n");
-
cairo_pattern_destroy (solid_rgb);
cairo_pattern_destroy (solid_rgba);
cairo_pattern_destroy (surface_pattern);
@@ -71,7 +63,12 @@ main (void)
cairo_pattern_destroy (linear);
cairo_pattern_destroy (radial);
- cairo_test_fini (&ctx);
-
return result;
}
+
+CAIRO_TEST (pattern_get_type,
+ "Creating patterns of all types",
+ "pattern, api", /* keywords */
+ NULL, /* requirements */
+ 0, 0,
+ preamble, NULL)