diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-09-03 16:38:03 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-10-31 12:30:11 +0000 |
commit | e90073f7ddc6f461a935bc360c409b04f1fe9f74 (patch) | |
tree | efda94d1ecd13143cdad23f14552661165e7601e /test/font-face-get-type.c | |
parent | 8457972d40088cda165f31fdd7bd9b4c19c6e095 (diff) |
[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/font-face-get-type.c')
-rw-r--r-- | test/font-face-get-type.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/font-face-get-type.c b/test/font-face-get-type.c index 32ebc47c..f6355e37 100644 --- a/test/font-face-get-type.c +++ b/test/font-face-get-type.c @@ -25,18 +25,15 @@ #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_t *cr; cairo_font_face_t *font_face; cairo_scaled_font_t *scaled_font; - cairo_test_init (&ctx, "font-face-get-type"); - - cairo_test_log (&ctx, "Creating cairo context and obtaining a font face\n"); + cairo_test_log (ctx, "Creating cairo context and obtaining a font face\n"); surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1); cr = cairo_create (surface); @@ -45,31 +42,34 @@ main (void) CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); - cairo_test_log (&ctx, "Testing return value of cairo_font_face_get_type\n"); + cairo_test_log (ctx, "Testing return value of cairo_font_face_get_type\n"); font_face = cairo_get_font_face (cr); if (cairo_font_face_get_type (font_face) != CAIRO_FONT_TYPE_TOY) { - cairo_test_log (&ctx, "Unexpected value %d from cairo_font_face_get_type (expected %d)\n", + cairo_test_log (ctx, "Unexpected value %d from cairo_font_face_get_type (expected %d)\n", cairo_font_face_get_type (font_face), CAIRO_FONT_TYPE_TOY); - cairo_test_fini (&ctx); return CAIRO_TEST_FAILURE; } - cairo_test_log (&ctx, "Testing return value of cairo_get_scaled_font\n"); + cairo_test_log (ctx, "Testing return value of cairo_get_scaled_font\n"); scaled_font = cairo_get_scaled_font (cr); if (cairo_scaled_font_get_font_face (scaled_font) != font_face) { - cairo_test_log (&ctx, "Font face returned from the scaled font is different from that returned by the context\n"); - cairo_test_fini (&ctx); + cairo_test_log (ctx, "Font face returned from the scaled font is different from that returned by the context\n"); return CAIRO_TEST_FAILURE; } cairo_destroy (cr); cairo_surface_destroy (surface); - cairo_test_fini (&ctx); - return CAIRO_TEST_SUCCESS; } + +CAIRO_TEST (font_face_get_type, + "Check the returned type from cairo_select_font_face.", + "font", /* keywords */ + NULL, /* requirements */ + 0, 0, + preamble, NULL) |