summaryrefslogtreecommitdiff
path: root/test/svg-surface.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/svg-surface.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/svg-surface.c')
-rw-r--r--test/svg-surface.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/svg-surface.c b/test/svg-surface.c
index c4eadc9f3..6f071cedd 100644
--- a/test/svg-surface.c
+++ b/test/svg-surface.c
@@ -86,30 +86,26 @@ draw (cairo_t *cr, int width, int height)
return CAIRO_TEST_SUCCESS;
}
-int
-main (void)
+static cairo_test_status_t
+preamble (cairo_test_context_t *ctx)
{
- cairo_test_context_t ctx;
cairo_t *cr;
- const char *filename = "svg-surface.svg";
+ const char *filename = "svg-surface-out.svg";
cairo_surface_t *surface;
- cairo_test_init (&ctx, "svg-surface");
- if (! (cairo_test_is_target_enabled (&ctx, "svg11") ||
- cairo_test_is_target_enabled (&ctx, "svg12")))
+ if (! cairo_test_is_target_enabled (ctx, "svg11") &&
+ ! cairo_test_is_target_enabled (ctx, "svg12"))
{
- cairo_test_fini (&ctx);
return CAIRO_TEST_UNTESTED;
}
surface = cairo_svg_surface_create (filename,
WIDTH_IN_POINTS, HEIGHT_IN_POINTS);
if (cairo_surface_status (surface)) {
- cairo_test_log (&ctx,
+ cairo_test_log (ctx,
"Failed to create svg surface for file %s: %s\n",
filename,
cairo_status_to_string (cairo_surface_status (surface)));
- cairo_test_fini (&ctx);
return CAIRO_TEST_FAILURE;
}
@@ -123,8 +119,12 @@ main (void)
cairo_surface_destroy (surface);
printf ("svg-surface: Please check svg-surface.svg to make sure it looks happy.\n");
-
- cairo_test_fini (&ctx);
-
return CAIRO_TEST_SUCCESS;
}
+
+CAIRO_TEST (svg_surface,
+ "Check creation of a SVG surface",
+ "svg", /* keywords */
+ NULL, /* requirements */
+ 0, 0,
+ preamble, NULL)