diff --git a/ChangeLog b/ChangeLog index 243ffaace..dcfc596e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-05-14 Carl Worth + + * test/cairo-test.c: (cairo_test_real): + * test/pdf-surface.c: (main): + * test/xlib-surface.c: (do_test), (main): Cleanup output a bit, + move verbose messages to test-specific log file. + 2005-05-14 Carl Worth * src/cairo-xlib-surface.c: (cairo_xlib_surface_create_with_visual): diff --git a/test/cairo-test.c b/test/cairo-test.c index 477411e6a..cd54b96bb 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -1,5 +1,5 @@ /* - * Copyright  2004 Red Hat, Inc. + * Copyright  2004 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without @@ -368,6 +368,10 @@ cairo_test_real (cairo_test_t *test, cairo_test_draw_function_t draw) xunlink (log_name); cairo_test_log_file = fopen (log_name, "a"); + if (cairo_test_log_file == NULL) { + fprintf (stderr, "Error opening log file: %s\n", log_name); + cairo_test_log_file = stderr; + } ret = CAIRO_TEST_SUCCESS; for (i=0; i < sizeof(targets)/sizeof(targets[0]); i++) { diff --git a/test/pdf-surface.c b/test/pdf-surface.c index f8febacd8..cf12325e7 100644 --- a/test/pdf-surface.c +++ b/test/pdf-surface.c @@ -39,6 +39,7 @@ main (void) FILE *file; cairo_surface_t *surface; + printf("\n"); file = fopen (filename, "w"); if (!file) { cairo_test_log ("Failed to open file %s\n", filename); diff --git a/test/xlib-surface.c b/test/xlib-surface.c index 75b65713d..47cc05380 100644 --- a/test/xlib-surface.c +++ b/test/xlib-surface.c @@ -33,9 +33,9 @@ #define SIZE 100 #define OFFSCREEN_OFFSET 50 -#define VERBOSE 0 cairo_bool_t result = 0; +FILE *log_file = NULL; static void draw_pattern (cairo_surface_t *surface) @@ -166,16 +166,14 @@ do_test (Display *dpy, 4 * SIZE); } - if (VERBOSE || !result) { - fprintf (stderr, "xlib-surface: %s, %s, %s%s: %s\n", - use_render ? " render" : "no-render", - set_size ? " size" : "no-size", - use_pixmap ? "pixmap" : "window", - use_pixmap ? - " " : - (offscreen ? ", offscreen" : ", onscreen"), - result ? "PASS" : "FAIL"); - } + fprintf (log_file, "xlib-surface: %s, %s, %s%s: %s\n", + use_render ? " render" : "no-render", + set_size ? " size" : "no-size", + use_pixmap ? "pixmap" : "window", + use_pixmap ? + " " : + (offscreen ? ", offscreen" : ", onscreen"), + result ? "PASS" : "FAIL"); return result; } @@ -209,14 +207,21 @@ main (void) cairo_bool_t offscreen; result = 0; + printf("\n"); + log_file = fopen ("xlib-surface.log", "w"); + if (log_file == NULL) { + fprintf (stderr, "Error opening log file: %s\n", "xlib-surface.log"); + log_file = stderr; + } + dpy = XOpenDisplay (NULL); if (!dpy) { - fprintf (stderr, "xlib-surface: Cannot open display, skipping\n"); + fprintf (log_file, "xlib-surface: Cannot open display, skipping\n"); return 0; } if (!check_visual (dpy)) { - fprintf (stderr, "xlib-surface: default visual is not RGB24 or BGR24, skipping\n"); + fprintf (log_file, "xlib-surface: default visual is not RGB24 or BGR24, skipping\n"); return 0; }