Cleanup output a bit, move verbose messages to test-specific log file.

This commit is contained in:
Carl Worth 2005-05-14 13:51:59 +00:00
parent 53e6fdb885
commit 6a1af1999d
4 changed files with 31 additions and 14 deletions

View file

@ -1,3 +1,10 @@
2005-05-14 Carl Worth <cworth@cworth.org>
* 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 <cworth@cworth.org>
* src/cairo-xlib-surface.c: (cairo_xlib_surface_create_with_visual):

View file

@ -1,5 +1,5 @@
/*
* Copyright <EFBFBD>Â<EFBFBD>© 2004 Red Hat, Inc.
* Copyright Â<EFBFBD>Â<EFBFBD>© 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++) {

View file

@ -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);

View file

@ -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;
}