summaryrefslogtreecommitdiff
path: root/test/select-font-face.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/select-font-face.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/select-font-face.c')
-rw-r--r--test/select-font-face.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/test/select-font-face.c b/test/select-font-face.c
index c5ff56b7d..74c127693 100644
--- a/test/select-font-face.c
+++ b/test/select-font-face.c
@@ -27,32 +27,21 @@
#define TEXT_SIZE 12
-static cairo_test_draw_function_t draw;
-
-static const cairo_test_t test = {
- "select-font-face",
- "Tests using cairo_select_font_face to draw text in different faces",
- 192, TEXT_SIZE + 4,
- draw
-};
-
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
/* We draw in the default black, so paint white first. */
- cairo_save (cr);
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
cairo_paint (cr);
- cairo_restore (cr);
cairo_set_source_rgb (cr, 0, 0, 0); /* black */
+ cairo_set_font_size (cr, TEXT_SIZE);
+ cairo_move_to (cr, 0, TEXT_SIZE);
+
cairo_select_font_face (cr, "Bitstream Vera Serif",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
- cairo_set_font_size (cr, TEXT_SIZE);
-
- cairo_move_to (cr, 0, TEXT_SIZE);
cairo_show_text (cr, "i-am-serif");
cairo_select_font_face (cr, "Bitstream Vera Sans",
@@ -68,8 +57,9 @@ draw (cairo_t *cr, int width, int height)
return CAIRO_TEST_SUCCESS;
}
-int
-main (void)
-{
- return cairo_test (&test);
-}
+CAIRO_TEST (select_font_face,
+ "Tests using cairo_select_font_face to draw text in different faces",
+ "font", /* keywords */
+ NULL, /* requirements */
+ 192, TEXT_SIZE + 4,
+ NULL, draw)