[cairo-commit] 12 commits - boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate-cogl.c boilerplate/cairo-boilerplate-directfb.c boilerplate/cairo-boilerplate-drm.c boilerplate/cairo-boilerplate-egl.c boilerplate/cairo-boilerplate-glx.c boilerplate/cairo-boilerplate.h boilerplate/cairo-boilerplate-pdf.c boilerplate/cairo-boilerplate-ps.c boilerplate/cairo-boilerplate-qt.cpp boilerplate/cairo-boilerplate-quartz.c boilerplate/cairo-boilerplate-script.c boilerplate/cairo-boilerplate-skia.c boilerplate/cairo-boilerplate-svg.c boilerplate/cairo-boilerplate-test-surfaces.c boilerplate/cairo-boilerplate-vg.c boilerplate/cairo-boilerplate-wgl.c boilerplate/cairo-boilerplate-win32.c boilerplate/cairo-boilerplate-win32-printing.c boilerplate/cairo-boilerplate-xcb.c boilerplate/cairo-boilerplate-xlib.c perf/cairo-analyse-trace.c perf/cairo-perf-micro.c perf/cairo-perf-report.c perf/cairo-perf-trace.c src/cairo-cogl-gradient.c src/cairo-cogl-surface.c test/cairo-test.c test/cairo-test .h test/cairo-test-private.h test/cairo-test-runner.c test/cairo-test-trace.c test/fallback-resolution.c test/Makefile.sources test/pass-through.c test/ps-eps.c util/cairo-sphinx
Andrea Canciani
ranma42 at kemper.freedesktop.org
Mon Nov 14 13:03:22 PST 2011
boilerplate/cairo-boilerplate-cogl.c | 2
boilerplate/cairo-boilerplate-directfb.c | 1
boilerplate/cairo-boilerplate-drm.c | 1
boilerplate/cairo-boilerplate-egl.c | 1
boilerplate/cairo-boilerplate-glx.c | 3
boilerplate/cairo-boilerplate-pdf.c | 1
boilerplate/cairo-boilerplate-ps.c | 7
boilerplate/cairo-boilerplate-qt.cpp | 1
boilerplate/cairo-boilerplate-quartz.c | 1
boilerplate/cairo-boilerplate-script.c | 1
boilerplate/cairo-boilerplate-skia.c | 1
boilerplate/cairo-boilerplate-svg.c | 15
boilerplate/cairo-boilerplate-test-surfaces.c | 9
boilerplate/cairo-boilerplate-vg.c | 2
boilerplate/cairo-boilerplate-wgl.c | 2
boilerplate/cairo-boilerplate-win32-printing.c | 1
boilerplate/cairo-boilerplate-win32.c | 1
boilerplate/cairo-boilerplate-xcb.c | 5
boilerplate/cairo-boilerplate-xlib.c | 45 -
boilerplate/cairo-boilerplate.c | 3
boilerplate/cairo-boilerplate.h | 1
perf/cairo-analyse-trace.c | 14
perf/cairo-perf-micro.c | 23
perf/cairo-perf-report.c | 6
perf/cairo-perf-trace.c | 38 -
src/cairo-cogl-gradient.c | 3
src/cairo-cogl-surface.c | 12
test/Makefile.sources | 1
test/cairo-test-private.h | 6
test/cairo-test-runner.c | 49 --
test/cairo-test-trace.c | 10
test/cairo-test.c | 596 ++++++-------------------
test/cairo-test.h | 9
test/fallback-resolution.c | 2
test/pass-through.c | 20
test/ps-eps.c | 1
util/cairo-sphinx/sphinx.c | 2
37 files changed, 246 insertions(+), 650 deletions(-)
New commits:
commit 1501c86536fcf21ce168644de58bfbc27ff6e710
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Tue Nov 1 18:02:15 2011 +0100
test: Do not open files in non-existing dirs
The output directory should be made before trying to open log files in
it.
Fixes the bug causing cairo-test-suite to log to stderr on the first
run (i.e. when test/output does not exist).
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 0943f67..9e0341b 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -102,6 +102,24 @@ static int cairo_test_timeout = 60;
#define NUM_DEVICE_OFFSETS 2
+static cairo_bool_t
+_cairo_test_mkdir (const char *path)
+{
+#if ! HAVE_MKDIR
+ return FALSE;
+#elif HAVE_MKDIR == 1
+ if (mkdir (path) == 0)
+ return TRUE;
+#elif HAVE_MKDIR == 2
+ if (mkdir (path, 0770) == 0)
+ return TRUE;
+#else
+#error Bad value for HAVE_MKDIR
+#endif
+
+ return errno == EEXIST;
+}
+
static char *
_cairo_test_fixup_name (const char *original)
{
@@ -139,6 +157,8 @@ _cairo_test_init (cairo_test_context_t *ctx,
ctx->test_name = _cairo_test_fixup_name (test_name);
ctx->output = output;
+ _cairo_test_mkdir (ctx->output);
+
ctx->malloc_failure = 0;
#if HAVE_MEMFAULT
if (getenv ("CAIRO_TEST_MALLOC_FAILURE"))
@@ -381,24 +401,6 @@ done:
return ref_name;
}
-static cairo_bool_t
-_cairo_test_mkdir (const char *path)
-{
-#if ! HAVE_MKDIR
- return FALSE;
-#elif HAVE_MKDIR == 1
- if (mkdir (path) == 0)
- return TRUE;
-#elif HAVE_MKDIR == 2
- if (mkdir (path, 0770) == 0)
- return TRUE;
-#else
-#error Bad value for HAVE_MKDIR
-#endif
-
- return errno == EEXIST;
-}
-
cairo_test_similar_t
cairo_test_target_has_similar (const cairo_test_context_t *ctx,
const cairo_boilerplate_target_t *target)
commit 603ea229b54c858d12ffc80a478f1fb0f4023a72
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Fri Oct 28 15:04:59 2011 +0200
test: Use cairo_test_list_t for the main test list
Instead of embedding the pointer in the test structure, consistently
use the cairo_test_list_t structure for test lists.
This cleans up the code as the reverse-list operation can be reused.
Moreover this makes the code clearer, because each test list is now
independent and has no way to know about other test lists.
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index 6a1fc98..b0e598d 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -107,7 +107,7 @@ typedef enum {
GT
} cairo_test_compare_op_t;
-static cairo_test_t *tests;
+static cairo_test_list_t *tests;
static void CAIRO_BOILERPLATE_PRINTF_FORMAT(2,3)
_log (cairo_test_context_t *ctx,
@@ -125,18 +125,6 @@ _log (cairo_test_context_t *ctx,
va_end (ap);
}
-static void
-_tests_reverse (void)
-{
- cairo_test_t *list, *next;
-
- for (list = tests, tests = NULL; list != NULL; list = next) {
- next = list->next;
- list->next = tests;
- tests = list;
- }
-}
-
static cairo_test_list_t *
_list_prepend (cairo_test_list_t *head, const cairo_test_t *test)
{
@@ -709,7 +697,7 @@ int
main (int argc, char **argv)
{
cairo_test_runner_t runner;
- cairo_test_t *test;
+ cairo_test_list_t *test_list;
cairo_test_status_t *target_status;
unsigned int n, m;
char targets[4096];
@@ -723,7 +711,7 @@ main (int argc, char **argv)
#endif
_cairo_test_runner_register_tests ();
- _tests_reverse ();
+ tests = _list_reverse (tests);
memset (&runner, 0, sizeof (runner));
runner.num_device_offsets = 1;
@@ -768,7 +756,8 @@ main (int argc, char **argv)
runner.base.num_targets);
}
- for (test = tests; test != NULL; test = test->next) {
+ for (test_list = tests; test_list != NULL; test_list = test_list->next) {
+ const cairo_test_t *test = test_list->test;
cairo_test_context_t ctx;
cairo_test_status_t status;
cairo_bool_t failed = FALSE, xfailed = FALSE, error = FALSE, crashed = FALSE, skipped = TRUE;
@@ -1097,6 +1086,5 @@ main (int argc, char **argv)
void
cairo_test_register (cairo_test_t *test)
{
- test->next = tests;
- tests = test;
+ tests = _list_prepend (tests, test);
}
diff --git a/test/cairo-test.h b/test/cairo-test.h
index 5e342a4..d41cd29 100644
--- a/test/cairo-test.h
+++ b/test/cairo-test.h
@@ -153,7 +153,6 @@ typedef cairo_test_status_t
(cairo_test_draw_function_t) (cairo_t *cr, int width, int height);
struct _cairo_test {
- struct _cairo_test *next;
const char *name;
const char *description;
const char *keywords;
@@ -194,7 +193,7 @@ struct _cairo_test {
void _register_##name (void); \
void _register_##name (void) { \
static cairo_test_t test = { \
- NULL, #name, description, \
+ #name, description, \
keywords, requirements, \
width, height, \
preamble, draw \
commit abced5b88281a2ada819ccfe670616024765b7f7
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Fri Oct 28 17:31:00 2011 +0200
boilerplate: Fix svg extension
The svg backend produces .svg files. Using the appropriate extension
allows the test suite to check the vector output in addition to the
PNG images.
diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c
index eda2f66..797106e 100644
--- a/boilerplate/cairo-boilerplate-svg.c
+++ b/boilerplate/cairo-boilerplate-svg.c
@@ -283,7 +283,7 @@ static const cairo_boilerplate_target_t targets[] = {
* tests. XXX: I'd still like to chase these down at some point.
* For now just set the svg error tolerance to 1. */
{
- "svg11", "svg", NULL, NULL,
+ "svg11", "svg", ".svg", NULL,
CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg11_create_surface,
@@ -296,7 +296,7 @@ static const cairo_boilerplate_target_t targets[] = {
NULL, NULL, FALSE, TRUE, TRUE
},
{
- "svg11", "svg", NULL, NULL,
+ "svg11", "svg", ".svg", NULL,
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg11_create_surface,
@@ -309,7 +309,7 @@ static const cairo_boilerplate_target_t targets[] = {
NULL, NULL, FALSE, TRUE, TRUE
},
{
- "svg12", "svg", NULL, NULL,
+ "svg12", "svg", ".svg", NULL,
CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg12_create_surface,
@@ -322,7 +322,7 @@ static const cairo_boilerplate_target_t targets[] = {
NULL, NULL, FALSE, TRUE, TRUE
},
{
- "svg12", "svg", NULL, NULL,
+ "svg12", "svg", ".svg", NULL,
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg12_create_surface,
commit de6a1e68fe89140d37fb4b64374c12a56b64f305
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Fri Oct 28 11:31:12 2011 +0200
Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic patch:
// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it
@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
- free(E);
(
- E = NULL;
|
- E = 0;
)
...
- }
@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
- free (E);
- }
diff --git a/src/cairo-cogl-gradient.c b/src/cairo-cogl-gradient.c
index 2dc0707..a4b9824 100644
--- a/src/cairo-cogl-gradient.c
+++ b/src/cairo-cogl-gradient.c
@@ -635,8 +635,7 @@ _cairo_cogl_get_linear_gradient (cairo_cogl_device_t *device,
return CAIRO_INT_STATUS_SUCCESS;
BAIL:
- if (entry)
- free (entry);
+ free (entry);
if (gradient)
_cairo_cogl_linear_gradient_destroy (gradient);
return status;
diff --git a/src/cairo-cogl-surface.c b/src/cairo-cogl-surface.c
index 0d990b3..3f9a782 100644
--- a/src/cairo-cogl-surface.c
+++ b/src/cairo-cogl-surface.c
@@ -2011,10 +2011,8 @@ _cairo_cogl_get_path_stroke_meta (cairo_cogl_surface_t *surface,
return meta;
BAIL:
- if (meta_path)
- free (meta_path);
- if (meta)
- free (meta);
+ free (meta_path);
+ free (meta);
return NULL;
}
@@ -2266,10 +2264,8 @@ _cairo_cogl_get_path_fill_meta (cairo_cogl_surface_t *surface)
return meta;
BAIL:
- if (meta_path)
- free (meta_path);
- if (meta)
- free (meta);
+ free (meta_path);
+ free (meta);
return NULL;
}
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 7dda8c2..0943f67 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -228,8 +228,7 @@ cairo_test_fini (cairo_test_context_t *ctx)
fclose (ctx->log_file);
ctx->log_file = NULL;
- if (ctx->ref_name != NULL)
- free (ctx->ref_name);
+ free (ctx->ref_name);
cairo_surface_destroy (ctx->ref_image);
cairo_surface_destroy (ctx->ref_image_flattened);
@@ -1387,18 +1386,11 @@ REPEAT:
}
UNWIND_CAIRO:
- if (test_filename != NULL) {
- free (test_filename);
- test_filename = NULL;
- }
- if (fail_filename != NULL) {
- free (fail_filename);
- fail_filename = NULL;
- }
- if (pass_filename != NULL) {
- free (pass_filename);
- pass_filename = NULL;
- }
+ free (test_filename);
+ free (fail_filename);
+ free (pass_filename);
+
+ test_filename = fail_filename = pass_filename = NULL;
#if HAVE_MEMFAULT
if (ret == CAIRO_TEST_FAILURE)
@@ -1442,32 +1434,19 @@ UNWIND_SURFACE:
}
UNWIND_STRINGS:
- if (out_png_path)
- free (out_png_path);
- if (ref_png_path)
- free (ref_png_path);
- if (base_ref_png_path)
- free (base_ref_png_path);
- if (ref_path)
- free (ref_path);
- if (new_png_path)
- free (new_png_path);
- if (base_new_png_path)
- free (base_new_png_path);
- if (new_path)
- free (new_path);
- if (xfail_png_path)
- free (xfail_png_path);
- if (base_xfail_png_path)
- free (base_xfail_png_path);
- if (xfail_path)
- free (xfail_path);
- if (diff_png_path)
- free (diff_png_path);
- if (base_path)
- free (base_path);
- if (base_name)
- free (base_name);
+ free (out_png_path);
+ free (ref_png_path);
+ free (base_ref_png_path);
+ free (ref_path);
+ free (new_png_path);
+ free (base_new_png_path);
+ free (new_path);
+ free (xfail_png_path);
+ free (base_xfail_png_path);
+ free (xfail_path);
+ free (diff_png_path);
+ free (base_path);
+ free (base_name);
return ret;
}
commit c65d4e35dcdebc21d80c440944c11e1067743a8f
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Wed Oct 26 17:46:53 2011 +0200
Use xstrdup instead of xmalloc when possible
Don't open code xstrdup, just use it.
diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c
index 8df78c6..38bdc0c 100644
--- a/perf/cairo-perf-report.c
+++ b/perf/cairo-perf-report.c
@@ -388,11 +388,9 @@ cairo_perf_report_load (cairo_perf_report_t *report,
if (name == NULL)
name = "stdin";
- configuration = xmalloc (strlen (name) * sizeof (char) + 1);
- strcpy (configuration, name);
+ configuration = xstrdup (name);
baseName = basename (configuration);
- report->configuration = xmalloc (strlen (baseName) * sizeof (char) + 1);
- strcpy (report->configuration, baseName);
+ report->configuration = xstrdup (baseName);
free (configuration);
dot = strrchr (report->configuration, '.');
diff --git a/test/cairo-test.c b/test/cairo-test.c
index a5ef633..7dda8c2 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -105,11 +105,9 @@ static int cairo_test_timeout = 60;
static char *
_cairo_test_fixup_name (const char *original)
{
- int len = strlen (original);
char *name, *s;
- name = xmalloc (len + 1);
- s = memcpy (name, original, len + 1);
+ s = name = xstrdup (original);
while ((s = strchr (s, '_')) != NULL)
*s++ = '-';
@@ -505,7 +503,6 @@ cairo_test_get_reference_image (cairo_test_context_t *ctx,
cairo_bool_t flatten)
{
cairo_surface_t *surface;
- int len;
if (ctx->ref_name != NULL) {
if (strcmp (ctx->ref_name, filename) == 0)
@@ -525,10 +522,7 @@ cairo_test_get_reference_image (cairo_test_context_t *ctx,
if (cairo_surface_status (surface))
return surface;
- len = strlen (filename);
- ctx->ref_name = xmalloc (len + 1);
- memcpy (ctx->ref_name, filename, len + 1);
-
+ ctx->ref_name = xstrdup (filename);
ctx->ref_image = surface;
return _cairo_test_flatten_reference_image (ctx, flatten);
}
commit 6dfb12c7d7c4ada716c86dbb9af3446d9880ed36
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Thu Oct 27 09:49:25 2011 +0200
test: Reuse cairo_test_logv()
cairo_test_log() can be implemented on top of cairo_test_logv() to
ensure that their behavior is consistent.
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 1a0c845..a5ef633 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -261,10 +261,9 @@ void
cairo_test_log (const cairo_test_context_t *ctx, const char *fmt, ...)
{
va_list va;
- FILE *file = ctx && ctx->log_file ? ctx->log_file : stderr;
va_start (va, fmt);
- vfprintf (file, fmt, va);
+ cairo_test_logv (ctx, fmt, va);
va_end (va);
}
commit 549b1f8d4bf6e20cecd281343f5e4630938697cc
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Wed Oct 26 19:16:17 2011 +0200
boilerplate: Remove unused thread id parameter
The thread id is not used anymore (it is always == 0), so it can be
removed.
diff --git a/boilerplate/cairo-boilerplate-cogl.c b/boilerplate/cairo-boilerplate-cogl.c
index 8dda317..e39ad33 100644
--- a/boilerplate/cairo-boilerplate-cogl.c
+++ b/boilerplate/cairo-boilerplate-cogl.c
@@ -66,7 +66,6 @@ _cairo_boilerplate_cogl_create_offscreen_color_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **abstract_closure)
{
cairo_device_t *device;
@@ -116,7 +115,6 @@ _cairo_boilerplate_cogl_create_onscreen_color_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **abstract_closure)
{
cairo_device_t *device;
diff --git a/boilerplate/cairo-boilerplate-directfb.c b/boilerplate/cairo-boilerplate-directfb.c
index be5efb6..a479011 100644
--- a/boilerplate/cairo-boilerplate-directfb.c
+++ b/boilerplate/cairo-boilerplate-directfb.c
@@ -175,7 +175,6 @@ _cairo_boilerplate_directfb_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
diff --git a/boilerplate/cairo-boilerplate-drm.c b/boilerplate/cairo-boilerplate-drm.c
index 8f04314..214ce50 100644
--- a/boilerplate/cairo-boilerplate-drm.c
+++ b/boilerplate/cairo-boilerplate-drm.c
@@ -42,7 +42,6 @@ _cairo_boilerplate_drm_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
cairo_device_t *device;
diff --git a/boilerplate/cairo-boilerplate-egl.c b/boilerplate/cairo-boilerplate-egl.c
index 0e1c9b9..ce0aceb 100644
--- a/boilerplate/cairo-boilerplate-egl.c
+++ b/boilerplate/cairo-boilerplate-egl.c
@@ -72,7 +72,6 @@ _cairo_boilerplate_egl_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
egl_target_closure_t *gltc;
diff --git a/boilerplate/cairo-boilerplate-glx.c b/boilerplate/cairo-boilerplate-glx.c
index 690844e..35e8192 100644
--- a/boilerplate/cairo-boilerplate-glx.c
+++ b/boilerplate/cairo-boilerplate-glx.c
@@ -74,7 +74,6 @@ _cairo_boilerplate_gl_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
int rgba_attribs[] = { GLX_RGBA,
@@ -151,7 +150,6 @@ _cairo_boilerplate_gl_create_window (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
int rgba_attribs[] = { GLX_RGBA,
@@ -232,7 +230,6 @@ _cairo_boilerplate_gl_create_window_db (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
int rgba_attribs[] = { GLX_RGBA,
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c
index 5173780..d76d139 100644
--- a/boilerplate/cairo-boilerplate-pdf.c
+++ b/boilerplate/cairo-boilerplate-pdf.c
@@ -64,7 +64,6 @@ _cairo_boilerplate_pdf_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
pdf_target_closure_t *ptc;
diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index 53c8cb8..ae61239 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -82,7 +82,6 @@ _cairo_boilerplate_ps_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
ps_target_closure_t *ptc;
@@ -144,14 +143,13 @@ _cairo_boilerplate_ps2_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
return _cairo_boilerplate_ps_create_surface (name, content,
CAIRO_PS_LEVEL_2,
width, height,
max_width, max_height,
- mode, id,
+ mode,
closure);
}
@@ -163,14 +161,13 @@ _cairo_boilerplate_ps3_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
return _cairo_boilerplate_ps_create_surface (name, content,
CAIRO_PS_LEVEL_3,
width, height,
max_width, max_height,
- mode, id,
+ mode,
closure);
}
diff --git a/boilerplate/cairo-boilerplate-qt.cpp b/boilerplate/cairo-boilerplate-qt.cpp
index bbeea4a..a559f4f 100644
--- a/boilerplate/cairo-boilerplate-qt.cpp
+++ b/boilerplate/cairo-boilerplate-qt.cpp
@@ -60,7 +60,6 @@ _cairo_boilerplate_qt_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
qt_closure_t *qtc;
diff --git a/boilerplate/cairo-boilerplate-quartz.c b/boilerplate/cairo-boilerplate-quartz.c
index 6b9697a..d4ca353 100644
--- a/boilerplate/cairo-boilerplate-quartz.c
+++ b/boilerplate/cairo-boilerplate-quartz.c
@@ -36,7 +36,6 @@ _cairo_boilerplate_quartz_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
cairo_format_t format;
diff --git a/boilerplate/cairo-boilerplate-script.c b/boilerplate/cairo-boilerplate-script.c
index f031744..da8ae3b 100644
--- a/boilerplate/cairo-boilerplate-script.c
+++ b/boilerplate/cairo-boilerplate-script.c
@@ -44,7 +44,6 @@ _cairo_boilerplate_script_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
script_target_closure_t *ptc;
diff --git a/boilerplate/cairo-boilerplate-skia.c b/boilerplate/cairo-boilerplate-skia.c
index 2bd31b0..c06e7f0 100644
--- a/boilerplate/cairo-boilerplate-skia.c
+++ b/boilerplate/cairo-boilerplate-skia.c
@@ -11,7 +11,6 @@ _cairo_boilerplate_skia_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
cairo_format_t format;
diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c
index 310dc5d..eda2f66 100644
--- a/boilerplate/cairo-boilerplate-svg.c
+++ b/boilerplate/cairo-boilerplate-svg.c
@@ -62,7 +62,6 @@ _cairo_boilerplate_svg_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
svg_target_closure_t *ptc;
@@ -117,7 +116,6 @@ _cairo_boilerplate_svg11_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
/* current default, but be explicit in case the default changes */
@@ -125,7 +123,7 @@ _cairo_boilerplate_svg11_create_surface (const char *name,
CAIRO_SVG_VERSION_1_1,
width, height,
max_width, max_height,
- mode, id,
+ mode,
closure);
}
@@ -137,14 +135,13 @@ _cairo_boilerplate_svg12_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
return _cairo_boilerplate_svg_create_surface (name, content,
CAIRO_SVG_VERSION_1_2,
width, height,
max_width, max_height,
- mode, id,
+ mode,
closure);
}
diff --git a/boilerplate/cairo-boilerplate-test-surfaces.c b/boilerplate/cairo-boilerplate-test-surfaces.c
index 73f2503..293b77f 100644
--- a/boilerplate/cairo-boilerplate-test-surfaces.c
+++ b/boilerplate/cairo-boilerplate-test-surfaces.c
@@ -44,7 +44,6 @@ _cairo_boilerplate_test_base_compositor_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
*closure = NULL;
@@ -60,7 +59,6 @@ _cairo_boilerplate_test_fallback_compositor_create_surface (const char *name
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
*closure = NULL;
@@ -75,7 +73,6 @@ _cairo_boilerplate_test_mask_compositor_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
*closure = NULL;
@@ -91,7 +88,6 @@ _cairo_boilerplate_test_traps_compositor_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
*closure = NULL;
@@ -106,7 +102,6 @@ _cairo_boilerplate_test_spans_compositor_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
*closure = NULL;
@@ -121,7 +116,6 @@ _cairo_boilerplate_test_no_fallback_compositor_create_surface (const char *n
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
if (mode == CAIRO_BOILERPLATE_MODE_TEST)
@@ -139,7 +133,6 @@ _cairo_boilerplate_test_no_traps_compositor_create_surface (const char *name
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
if (mode == CAIRO_BOILERPLATE_MODE_TEST)
@@ -157,7 +150,6 @@ _cairo_boilerplate_test_no_spans_compositor_create_surface (const char *name
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
if (mode == CAIRO_BOILERPLATE_MODE_TEST)
@@ -182,7 +174,6 @@ _cairo_boilerplate_test_paginated_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
test_paginated_closure_t *tpc;
diff --git a/boilerplate/cairo-boilerplate-vg.c b/boilerplate/cairo-boilerplate-vg.c
index a49ed5d..ee32b3c 100644
--- a/boilerplate/cairo-boilerplate-vg.c
+++ b/boilerplate/cairo-boilerplate-vg.c
@@ -78,7 +78,6 @@ _cairo_boilerplate_vg_create_surface_glx (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
int rgba_attribs[] = {
@@ -207,7 +206,6 @@ _cairo_boilerplate_vg_create_surface_egl (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
int rgba_attribs[] = {
diff --git a/boilerplate/cairo-boilerplate-wgl.c b/boilerplate/cairo-boilerplate-wgl.c
index 8ae1dcb..9088177 100644
--- a/boilerplate/cairo-boilerplate-wgl.c
+++ b/boilerplate/cairo-boilerplate-wgl.c
@@ -109,7 +109,6 @@ _cairo_boilerplate_wgl_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
wgl_target_closure_t *wgltc;
@@ -146,7 +145,6 @@ _cairo_boilerplate_wgl_for_create_window (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
wgl_target_closure_t *wgltc;
diff --git a/boilerplate/cairo-boilerplate-win32-printing.c b/boilerplate/cairo-boilerplate-win32-printing.c
index 0e54512..c251bbf 100644
--- a/boilerplate/cairo-boilerplate-win32-printing.c
+++ b/boilerplate/cairo-boilerplate-win32-printing.c
@@ -169,7 +169,6 @@ _cairo_boilerplate_win32_printing_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
win32_target_closure_t *ptc;
diff --git a/boilerplate/cairo-boilerplate-win32.c b/boilerplate/cairo-boilerplate-win32.c
index f7be663..7469cc7 100644
--- a/boilerplate/cairo-boilerplate-win32.c
+++ b/boilerplate/cairo-boilerplate-win32.c
@@ -36,7 +36,6 @@ _cairo_boilerplate_win32_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
cairo_format_t format;
diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c
index f9810ee..979f5b5 100644
--- a/boilerplate/cairo-boilerplate-xcb.c
+++ b/boilerplate/cairo-boilerplate-xcb.c
@@ -245,7 +245,6 @@ _cairo_boilerplate_xcb_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
xcb_screen_t *root;
@@ -394,7 +393,6 @@ _cairo_boilerplate_xcb_create_window (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
xcb_target_closure_t *xtc;
@@ -471,7 +469,6 @@ _cairo_boilerplate_xcb_create_window_db (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
xcb_target_closure_t *xtc;
@@ -549,7 +546,6 @@ _cairo_boilerplate_xcb_create_render_0_0 (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
xcb_screen_t *root;
@@ -651,7 +647,6 @@ _cairo_boilerplate_xcb_create_fallback (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
xcb_target_closure_t *xtc;
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 38c1135..abd1ba9 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -280,7 +280,6 @@ _cairo_boilerplate_xlib_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
xlib_target_closure_t *xtc;
@@ -323,13 +322,11 @@ _cairo_boilerplate_xlib_window_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
xlib_target_closure_t *xtc;
Display *dpy;
- Screen *scr;
- int screen, x, y;
+ int screen;
XSetWindowAttributes attr;
cairo_surface_t *surface;
@@ -374,25 +371,9 @@ _cairo_boilerplate_xlib_window_create_surface (const char *name,
return NULL;
}
- /* tile the windows so threads do not overlap */
- scr = XScreenOfDisplay (dpy, screen);
- x = 10; y = 15;
- if (id-- > 1) do {
- x += max_width;
- if (x + max_width > WidthOfScreen (scr)) {
- x = 10;
- y += max_height;
- if (y + max_height > HeightOfScreen (scr)) {
- XCloseDisplay (dpy);
- free (xtc);
- return NULL;
- }
- }
- } while (--id);
-
attr.override_redirect = True;
xtc->drawable = XCreateWindow (dpy, DefaultRootWindow (dpy),
- x, y,
+ 0, 0,
width, height, 0,
DefaultDepth (dpy, screen),
InputOutput,
@@ -475,13 +456,11 @@ _cairo_boilerplate_xlib_fallback_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
xlib_target_closure_t *xtc;
Display *dpy;
- Screen *scr;
- int screen, x, y;
+ int screen;
XSetWindowAttributes attr;
cairo_surface_t *surface;
@@ -526,25 +505,9 @@ _cairo_boilerplate_xlib_fallback_create_surface (const char *name,
return NULL;
}
- /* tile the windows so threads do not overlap */
- scr = XScreenOfDisplay (dpy, screen);
- x = y = 0;
- if (id-- > 1) do {
- x += max_width;
- if (x + max_width > WidthOfScreen (scr)) {
- x = 0;
- y += max_height;
- if (y + max_height > HeightOfScreen (scr)) {
- XCloseDisplay (dpy);
- free (xtc);
- return NULL;
- }
- }
- } while (--id);
-
attr.override_redirect = True;
xtc->drawable = XCreateWindow (dpy, DefaultRootWindow (dpy),
- x, y,
+ 0, 0,
width, height, 0,
DefaultDepth (dpy, screen),
InputOutput,
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index b4b492f..89ab1ce 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -132,7 +132,6 @@ _cairo_boilerplate_image_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
cairo_format_t format;
@@ -188,7 +187,6 @@ _cairo_boilerplate_image16_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
*closure = NULL;
@@ -243,7 +241,6 @@ _cairo_boilerplate_recording_create_surface (const char *name,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure)
{
cairo_rectangle_t extents;
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index b1a1f1c..461b98b 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -124,7 +124,6 @@ typedef cairo_surface_t *
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
- int id,
void **closure);
typedef cairo_surface_t *
diff --git a/perf/cairo-analyse-trace.c b/perf/cairo-analyse-trace.c
index 5e0ad70..9941486 100644
--- a/perf/cairo-analyse-trace.c
+++ b/perf/cairo-analyse-trace.c
@@ -418,7 +418,6 @@ cairo_perf_trace (cairo_perf_t *perf,
1, 1,
1, 1,
CAIRO_BOILERPLATE_MODE_PERF,
- 0,
&args.closure);
args.surface =
cairo_surface_create_observer (real,
diff --git a/perf/cairo-perf-micro.c b/perf/cairo-perf-micro.c
index 572593b..7aa20ca 100644
--- a/perf/cairo-perf-micro.c
+++ b/perf/cairo-perf-micro.c
@@ -508,7 +508,6 @@ main (int argc,
perf.size, perf.size,
perf.size, perf.size,
CAIRO_BOILERPLATE_MODE_PERF,
- 0,
&closure);
if (surface == NULL) {
fprintf (stderr,
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index 7259f2f..bd0cb07 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -699,7 +699,6 @@ cairo_perf_trace (cairo_perf_t *perf,
1, 1,
1, 1,
CAIRO_BOILERPLATE_MODE_PERF,
- 0,
&args.closure);
if (perf->observe) {
cairo_surface_t *obs;
diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c
index fdc8a62..52d9dd9 100644
--- a/test/cairo-test-trace.c
+++ b/test/cairo-test-trace.c
@@ -591,7 +591,6 @@ spawn_target (const char *socket_path,
1, 1,
1, 1,
CAIRO_BOILERPLATE_MODE_TEST,
- 0,
&tr.closure);
if (tr.surface == NULL) {
fprintf (stderr,
diff --git a/test/cairo-test.c b/test/cairo-test.c
index bcb0fdc..1a0c845 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -436,7 +436,6 @@ cairo_test_target_has_similar (const cairo_test_context_t *ctx,
ctx->test->width + 25 * NUM_DEVICE_OFFSETS,
ctx->test->height + 25 * NUM_DEVICE_OFFSETS,
CAIRO_BOILERPLATE_MODE_TEST,
- 0,
&closure);
if (surface == NULL)
goto out;
@@ -821,7 +820,6 @@ REPEAT:
ctx->test->width + 25 * NUM_DEVICE_OFFSETS,
ctx->test->height + 25 * NUM_DEVICE_OFFSETS,
CAIRO_BOILERPLATE_MODE_TEST,
- 0,
&closure);
if (surface == NULL) {
cairo_test_log (ctx, "Error: Failed to set %s target\n", target->name);
diff --git a/test/fallback-resolution.c b/test/fallback-resolution.c
index 5447a56..b14cc1e 100644
--- a/test/fallback-resolution.c
+++ b/test/fallback-resolution.c
@@ -382,7 +382,6 @@ preamble (cairo_test_context_t *ctx)
SIZE, SIZE,
SIZE, SIZE,
CAIRO_BOILERPLATE_MODE_TEST,
- 0,
&closure);
if (surface == NULL) {
@@ -417,7 +416,6 @@ preamble (cairo_test_context_t *ctx)
SIZE + 25, SIZE + 25,
SIZE + 25, SIZE + 25,
CAIRO_BOILERPLATE_MODE_TEST,
- 0,
&closure);
if (surface == NULL || cairo_surface_status (surface)) {
cairo_test_log (ctx, "Failed to generate surface: %s.%s\n",
diff --git a/test/ps-eps.c b/test/ps-eps.c
index 33802f3..1961463 100644
--- a/test/ps-eps.c
+++ b/test/ps-eps.c
@@ -288,7 +288,6 @@ preamble (cairo_test_context_t *ctx)
WIDTH, HEIGHT,
WIDTH, HEIGHT,
CAIRO_BOILERPLATE_MODE_TEST,
- 0,
&closure);
if (surface == NULL) {
diff --git a/util/cairo-sphinx/sphinx.c b/util/cairo-sphinx/sphinx.c
index 40d6776..7bc1c50 100644
--- a/util/cairo-sphinx/sphinx.c
+++ b/util/cairo-sphinx/sphinx.c
@@ -1378,7 +1378,7 @@ do_client (int fd,
client.surface = client.target->create_surface (NULL, content, 1, 1, 1, 1,
CAIRO_BOILERPLATE_MODE_TEST,
- 0, &closure);
+ &closure);
if (client.surface == NULL) {
fprintf (stderr, "Failed to create target surface: %s.\n",
client.target->name);
commit b07b242220daab5b9252d9f0d889886ad74bd31d
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Wed Oct 26 18:17:03 2011 +0200
test: Remove unused thread field
The multi-threaded test path does not exist anymore and the ctx->thread
field is always 0, hence it can be removed.
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 0b54ea1..bcb0fdc 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -167,8 +167,6 @@ _cairo_test_init (cairo_test_context_t *ctx,
ctx->ref_image = NULL;
ctx->ref_image_flattened = NULL;
- ctx->thread = 0;
-
if (parent != NULL) {
ctx->targets_to_test = parent->targets_to_test;
ctx->num_targets = parent->num_targets;
@@ -225,9 +223,6 @@ cairo_test_init (cairo_test_context_t *ctx,
void
cairo_test_fini (cairo_test_context_t *ctx)
{
- if (ctx->thread != 0)
- return;
-
if (ctx->log_file == NULL)
return;
@@ -647,7 +642,7 @@ cairo_test_for_target (cairo_test_context_t *ctx,
cairo_surface_t *surface = NULL;
cairo_t *cr;
const char *empty_str = "";
- char *offset_str, *thread_str;
+ char *offset_str;
char *base_name, *base_path;
char *out_png_path;
char *ref_path = NULL, *ref_png_path, *cmp_png_path = NULL;
@@ -678,24 +673,16 @@ cairo_test_for_target (cairo_test_context_t *ctx,
xasprintf (&offset_str, ".%d", dev_offset);
else
offset_str = (char *) empty_str;
- if (ctx->thread)
- xasprintf (&thread_str, ".thread%d", ctx->thread);
- else
- thread_str = (char *) empty_str;
- xasprintf (&base_name, "%s.%s.%s%s%s%s",
+ xasprintf (&base_name, "%s.%s.%s%s%s",
ctx->test_name,
target->name,
format,
similar ? ".similar" : "",
- offset_str,
- thread_str);
+ offset_str);
if (offset_str != empty_str)
free (offset_str);
- if (thread_str != empty_str)
- free (thread_str);
-
ref_png_path = cairo_test_reference_filename (ctx,
base_name,
@@ -834,7 +821,7 @@ REPEAT:
ctx->test->width + 25 * NUM_DEVICE_OFFSETS,
ctx->test->height + 25 * NUM_DEVICE_OFFSETS,
CAIRO_BOILERPLATE_MODE_TEST,
- ctx->thread,
+ 0,
&closure);
if (surface == NULL) {
cairo_test_log (ctx, "Error: Failed to set %s target\n", target->name);
@@ -962,15 +949,13 @@ REPEAT:
cairo_surface_destroy (surface);
if (target->cleanup)
target->cleanup (closure);
- if (ctx->thread == 0) {
- cairo_debug_reset_static_data ();
+ cairo_debug_reset_static_data ();
#if HAVE_FCFINI
- FcFini ();
+ FcFini ();
#endif
- if (MEMFAULT_COUNT_LEAKS () > 0) {
- MEMFAULT_PRINT_FAULTS ();
- MEMFAULT_PRINT_LEAKS ();
- }
+ if (MEMFAULT_COUNT_LEAKS () > 0) {
+ MEMFAULT_PRINT_FAULTS ();
+ MEMFAULT_PRINT_LEAKS ();
}
goto REPEAT;
@@ -1019,15 +1004,13 @@ REPEAT:
cairo_surface_destroy (surface);
if (target->cleanup)
target->cleanup (closure);
- if (ctx->thread == 0) {
- cairo_debug_reset_static_data ();
+ cairo_debug_reset_static_data ();
#if HAVE_FCFINI
- FcFini ();
+ FcFini ();
#endif
- if (MEMFAULT_COUNT_LEAKS () > 0) {
- MEMFAULT_PRINT_FAULTS ();
- MEMFAULT_PRINT_LEAKS ();
- }
+ if (MEMFAULT_COUNT_LEAKS () > 0) {
+ MEMFAULT_PRINT_FAULTS ();
+ MEMFAULT_PRINT_LEAKS ();
}
goto REPEAT;
@@ -1438,37 +1421,33 @@ UNWIND_SURFACE:
target->cleanup (closure);
#if HAVE_MEMFAULT
- if (ctx->thread == 0) {
- cairo_debug_reset_static_data ();
+ cairo_debug_reset_static_data ();
#if HAVE_FCFINI
- FcFini ();
+ FcFini ();
#endif
- if (MEMFAULT_COUNT_LEAKS () > 0) {
- if (ret != CAIRO_TEST_FAILURE)
- MEMFAULT_PRINT_FAULTS ();
- MEMFAULT_PRINT_LEAKS ();
- }
+ if (MEMFAULT_COUNT_LEAKS () > 0) {
+ if (ret != CAIRO_TEST_FAILURE)
+ MEMFAULT_PRINT_FAULTS ();
+ MEMFAULT_PRINT_LEAKS ();
}
if (ret == CAIRO_TEST_SUCCESS && --malloc_failure_iterations > 0)
goto REPEAT;
#endif
- if (ctx->thread == 0) {
- if (have_output)
- cairo_test_log (ctx, "OUTPUT: %s\n", out_png_path);
+ if (have_output)
+ cairo_test_log (ctx, "OUTPUT: %s\n", out_png_path);
- if (have_result) {
- if (cmp_png_path == NULL) {
- /* XXX presume we matched the normal ref last time */
- cmp_png_path = ref_png_path;
- }
- cairo_test_log (ctx,
- "REFERENCE: %s\nDIFFERENCE: %s\n",
- cmp_png_path, diff_png_path);
+ if (have_result) {
+ if (cmp_png_path == NULL) {
+ /* XXX presume we matched the normal ref last time */
+ cmp_png_path = ref_png_path;
}
+ cairo_test_log (ctx,
+ "REFERENCE: %s\nDIFFERENCE: %s\n",
+ cmp_png_path, diff_png_path);
}
UNWIND_STRINGS:
@@ -1538,16 +1517,14 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
target->name,
dev_offset);
- if (ctx->thread == 0) {
- printf ("%s.%s.%s [%d]%s:\t", ctx->test_name, target->name,
- cairo_boilerplate_content_name (target->content),
- dev_offset,
- similar ? " (similar)": "");
- fflush (stdout);
- }
+ printf ("%s.%s.%s [%d]%s:\t", ctx->test_name, target->name,
+ cairo_boilerplate_content_name (target->content),
+ dev_offset,
+ similar ? " (similar)": "");
+ fflush (stdout);
#if defined(HAVE_SIGNAL_H) && defined(HAVE_SETJMP_H)
- if (ctx->thread == 0 && ! RUNNING_ON_VALGRIND) {
+ if (! RUNNING_ON_VALGRIND) {
void (* volatile old_segfault_handler)(int);
void (* volatile old_segfpe_handler)(int);
void (* volatile old_sigpipe_handler)(int);
@@ -1596,141 +1573,100 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
status = cairo_test_for_target (ctx, target, dev_offset, similar);
#endif
- if (ctx->thread == 0) {
- cairo_test_log (ctx,
- "TEST: %s TARGET: %s FORMAT: %s OFFSET: %d SIMILAR: %d RESULT: ",
- ctx->test_name, target->name,
- cairo_boilerplate_content_name (target->content),
- dev_offset, similar);
- switch (status) {
- case CAIRO_TEST_SUCCESS:
- printf ("PASS\n");
- cairo_test_log (ctx, "PASS\n");
- break;
-
- case CAIRO_TEST_UNTESTED:
- printf ("UNTESTED\n");
- cairo_test_log (ctx, "UNTESTED\n");
- break;
-
- default:
- case CAIRO_TEST_CRASHED:
- if (print_fail_on_stdout && ctx->thread == 0) {
- printf ("!!!CRASHED!!!\n");
- } else {
- /* eat the test name */
- printf ("\r");
- fflush (stdout);
- }
- cairo_test_log (ctx, "CRASHED\n");
- fprintf (stderr, "%s.%s.%s [%d]%s:\t%s!!!CRASHED!!!%s\n",
- ctx->test_name, target->name,
- cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
- fail_face, normal_face);
- break;
-
- case CAIRO_TEST_ERROR:
- if (print_fail_on_stdout && ctx->thread == 0) {
- printf ("!!!ERROR!!!\n");
- } else {
- /* eat the test name */
- printf ("\r");
- fflush (stdout);
- }
- cairo_test_log (ctx, "ERROR\n");
- fprintf (stderr, "%s.%s.%s [%d]%s:\t%s!!!ERROR!!!%s\n",
- ctx->test_name, target->name,
- cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
- fail_face, normal_face);
- break;
-
- case CAIRO_TEST_XFAILURE:
- if (print_fail_on_stdout && ctx->thread == 0) {
- printf ("XFAIL\n");
- } else {
- /* eat the test name */
- printf ("\r");
- fflush (stdout);
- }
- fprintf (stderr, "%s.%s.%s [%d]%s:\t%sXFAIL%s\n",
- ctx->test_name, target->name,
- cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
- xfail_face, normal_face);
- cairo_test_log (ctx, "XFAIL\n");
- break;
-
- case CAIRO_TEST_NEW:
- if (print_fail_on_stdout && ctx->thread == 0) {
- printf ("NEW\n");
- } else {
- /* eat the test name */
- printf ("\r");
- fflush (stdout);
- }
- fprintf (stderr, "%s.%s.%s [%d]%s:\t%sNEW%s\n",
- ctx->test_name, target->name,
- cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
- fail_face, normal_face);
- cairo_test_log (ctx, "NEW\n");
- break;
-
- case CAIRO_TEST_NO_MEMORY:
- case CAIRO_TEST_FAILURE:
- if (print_fail_on_stdout && ctx->thread == 0) {
- printf ("FAIL\n");
- } else {
- /* eat the test name */
- printf ("\r");
- fflush (stdout);
- }
- fprintf (stderr, "%s.%s.%s [%d]%s:\t%sFAIL%s\n",
- ctx->test_name, target->name,
- cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
- fail_face, normal_face);
- cairo_test_log (ctx, "FAIL\n");
- break;
- }
- fflush (stdout);
- } else {
-#if HAVE_FLOCKFILE && HAVE_FUNLOCKFILE
- flockfile (stdout);
-#endif
- printf ("%s.%s.%s %d [%d]:\t",
- ctx->test_name, target->name,
- cairo_boilerplate_content_name (target->content),
- ctx->thread,
- dev_offset);
- switch (status) {
- case CAIRO_TEST_SUCCESS:
- printf ("PASS\n");
- break;
- case CAIRO_TEST_UNTESTED:
- printf ("UNTESTED\n");
- break;
- default:
- case CAIRO_TEST_CRASHED:
+ cairo_test_log (ctx,
+ "TEST: %s TARGET: %s FORMAT: %s OFFSET: %d SIMILAR: %d RESULT: ",
+ ctx->test_name, target->name,
+ cairo_boilerplate_content_name (target->content),
+ dev_offset, similar);
+ switch (status) {
+ case CAIRO_TEST_SUCCESS:
+ printf ("PASS\n");
+ cairo_test_log (ctx, "PASS\n");
+ break;
+
+ case CAIRO_TEST_UNTESTED:
+ printf ("UNTESTED\n");
+ cairo_test_log (ctx, "UNTESTED\n");
+ break;
+
+ default:
+ case CAIRO_TEST_CRASHED:
+ if (print_fail_on_stdout) {
printf ("!!!CRASHED!!!\n");
- break;
- case CAIRO_TEST_ERROR:
- printf ("!!!ERRORED!!!\n");
- break;
- case CAIRO_TEST_XFAILURE:
+ } else {
+ /* eat the test name */
+ printf ("\r");
+ fflush (stdout);
+ }
+ cairo_test_log (ctx, "CRASHED\n");
+ fprintf (stderr, "%s.%s.%s [%d]%s:\t%s!!!CRASHED!!!%s\n",
+ ctx->test_name, target->name,
+ cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
+ fail_face, normal_face);
+ break;
+
+ case CAIRO_TEST_ERROR:
+ if (print_fail_on_stdout) {
+ printf ("!!!ERROR!!!\n");
+ } else {
+ /* eat the test name */
+ printf ("\r");
+ fflush (stdout);
+ }
+ cairo_test_log (ctx, "ERROR\n");
+ fprintf (stderr, "%s.%s.%s [%d]%s:\t%s!!!ERROR!!!%s\n",
+ ctx->test_name, target->name,
+ cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
+ fail_face, normal_face);
+ break;
+
+ case CAIRO_TEST_XFAILURE:
+ if (print_fail_on_stdout) {
printf ("XFAIL\n");
- break;
- case CAIRO_TEST_NEW:
+ } else {
+ /* eat the test name */
+ printf ("\r");
+ fflush (stdout);
+ }
+ fprintf (stderr, "%s.%s.%s [%d]%s:\t%sXFAIL%s\n",
+ ctx->test_name, target->name,
+ cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
+ xfail_face, normal_face);
+ cairo_test_log (ctx, "XFAIL\n");
+ break;
+
+ case CAIRO_TEST_NEW:
+ if (print_fail_on_stdout) {
printf ("NEW\n");
- break;
- case CAIRO_TEST_NO_MEMORY:
- case CAIRO_TEST_FAILURE:
+ } else {
+ /* eat the test name */
+ printf ("\r");
+ fflush (stdout);
+ }
+ fprintf (stderr, "%s.%s.%s [%d]%s:\t%sNEW%s\n",
+ ctx->test_name, target->name,
+ cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
+ fail_face, normal_face);
+ cairo_test_log (ctx, "NEW\n");
+ break;
+
+ case CAIRO_TEST_NO_MEMORY:
+ case CAIRO_TEST_FAILURE:
+ if (print_fail_on_stdout) {
printf ("FAIL\n");
- break;
+ } else {
+ /* eat the test name */
+ printf ("\r");
+ fflush (stdout);
}
-
- fflush (stdout);
-#if HAVE_FLOCKFILE && HAVE_FUNLOCKFILE
- funlockfile (stdout);
-#endif
+ fprintf (stderr, "%s.%s.%s [%d]%s:\t%sFAIL%s\n",
+ ctx->test_name, target->name,
+ cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "",
+ fail_face, normal_face);
+ cairo_test_log (ctx, "FAIL\n");
+ break;
}
+ fflush (stdout);
return status;
}
diff --git a/test/cairo-test.h b/test/cairo-test.h
index 843d88a..5e342a4 100644
--- a/test/cairo-test.h
+++ b/test/cairo-test.h
@@ -237,8 +237,6 @@ struct _cairo_test_context {
int last_fault_count;
int timeout;
-
- int thread;
};
/* Retrieve the test context from the cairo_t, used for logging, paths etc */
commit 6ef9779a6f5cb86fc0e858ce017a5d2c9efbaa43
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Wed Oct 26 17:24:37 2011 +0200
test: Remove dead code
This code is unused and can be removed.
diff --git a/test/cairo-test-private.h b/test/cairo-test-private.h
index bd0c0ac..3e40324 100644
--- a/test/cairo-test-private.h
+++ b/test/cairo-test-private.h
@@ -46,9 +46,6 @@ cairo_test_target_has_similar (const cairo_test_context_t *ctx,
const cairo_boilerplate_target_t *target);
cairo_test_status_t
-_cairo_test_context_run (cairo_test_context_t *ctx);
-
-cairo_test_status_t
_cairo_test_context_run_for_target (cairo_test_context_t *ctx,
const cairo_boilerplate_target_t *target,
cairo_bool_t similar,
@@ -64,9 +61,6 @@ cairo_test_init (cairo_test_context_t *ctx,
const char *test_name,
const char *output);
-cairo_test_status_t
-cairo_test (const cairo_test_t *test);
-
void
cairo_test_fini (cairo_test_context_t *ctx);
diff --git a/test/cairo-test.c b/test/cairo-test.c
index b2d6b3f..0b54ea1 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -222,17 +222,6 @@ cairo_test_init (cairo_test_context_t *ctx,
_cairo_test_init (ctx, NULL, NULL, test_name, output);
}
-static void
-cairo_test_init_thread (cairo_test_context_t *ctx,
- cairo_test_context_t *master,
- int thread)
-{
- MF (MEMFAULT_DISABLE_FAULTS ());
-
- *ctx = *master;
- ctx->thread = thread;
-}
-
void
cairo_test_fini (cairo_test_context_t *ctx)
{
@@ -284,42 +273,6 @@ cairo_test_log (const cairo_test_context_t *ctx, const char *fmt, ...)
va_end (va);
}
-void
-cairo_test_log_path (const cairo_test_context_t *ctx,
- const cairo_path_t *path)
-{
- int i;
-
- for (i = 0; i < path->num_data; i += path->data[i].header.length) {
- cairo_path_data_t *data = &path->data[i];
- switch (data->header.type) {
- case CAIRO_PATH_MOVE_TO:
- cairo_test_log (ctx,
- " cairo_move_to (cr, %g, %g);\n",
- data[1].point.x, data[1].point.y);
- break;
- case CAIRO_PATH_LINE_TO:
- cairo_test_log (ctx,
- " cairo_line_to (cr, %g, %g);\n",
- data[1].point.x, data[1].point.y);
- break;
- case CAIRO_PATH_CURVE_TO:
- cairo_test_log (ctx,
- " cairo_curve_to (cr, %g, %g, %g, %g, %g, %g);\n",
- data[1].point.x, data[1].point.y,
- data[2].point.x, data[2].point.y,
- data[3].point.x, data[3].point.y);
- break;
- case CAIRO_PATH_CLOSE_PATH:
- cairo_test_log (ctx,
- " cairo_close_path (cr);\n\n");
- break;
- default:
- assert (0);
- }
- }
-}
-
static void
_xunlink (const cairo_test_context_t *ctx, const char *pathname)
{
@@ -1782,143 +1735,6 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
return status;
}
-cairo_test_status_t
-_cairo_test_context_run (cairo_test_context_t *ctx)
-{
- size_t i, j;
- cairo_test_status_t ret;
-
- ret = CAIRO_TEST_UNTESTED;
- if (ctx->test->preamble != NULL)
- ret = ctx->test->preamble (ctx);
-
- if (ctx->test->draw == NULL)
- return ret;
-
- /* The intended logic here is that we return overall SUCCESS
- * iff. there is at least one tested backend and that all tested
- * backends return SUCCESS, OR, there's backends were manually
- * limited, and none were tested.
- * In other words:
- *
- * if backends limited and no backend tested
- * -> SUCCESS
- * else if any backend not SUCCESS
- * -> FAILURE
- * else if all backends UNTESTED
- * -> FAILURE
- * else (== some backend SUCCESS)
- * -> SUCCESS
- *
- * Also, on a crash, run no further tests.
- */
- for (i = 0; i < ctx->num_targets && ret != CAIRO_TEST_CRASHED; i++) {
- const cairo_boilerplate_target_t *target = ctx->targets_to_test[(i + ctx->thread) % ctx->num_targets];
-
- for (j = 0; j < NUM_DEVICE_OFFSETS; j++) {
- int dev_offset = ((j + ctx->thread) % NUM_DEVICE_OFFSETS) * 25;
- cairo_test_similar_t similar, has_similar;
-
- has_similar = cairo_test_target_has_similar (ctx, target);
- for (similar = DIRECT; similar <= has_similar; similar++) {
- cairo_status_t status;
-
- status = _cairo_test_context_run_for_target (ctx,
- target,
- similar,
- dev_offset);
- if (ret == CAIRO_TEST_UNTESTED)
- ret = status;
- }
- }
- }
-
- return ret;
-}
-
-#if CAIRO_HAS_REAL_PTHREAD
-typedef struct _cairo_test_thread {
- pthread_t thread;
- cairo_test_context_t *ctx;
- size_t id;
-} cairo_test_thread_t;
-
-static void *
-cairo_test_run_threaded (void *closure)
-{
- cairo_test_thread_t *arg = closure;
- cairo_test_context_t ctx;
- cairo_test_status_t ret;
-
- cairo_test_init_thread (&ctx, arg->ctx, arg->id);
-
- ret = _cairo_test_context_run (&ctx);
-
- cairo_test_fini (&ctx);
-
- return (void *) ret;
-}
-#endif
-
-
-static cairo_test_status_t
-cairo_test_expecting (const cairo_test_t *test)
-{
- cairo_test_context_t ctx;
- cairo_test_status_t ret = CAIRO_TEST_SUCCESS;
- size_t num_threads;
-
- _cairo_test_init (&ctx, NULL, test, test->name, CAIRO_TEST_OUTPUT_DIR);
- printf ("%s\n", test->description);
-
-#if CAIRO_HAS_REAL_PTHREAD
- num_threads = 0;
- if (getenv ("CAIRO_TEST_NUM_THREADS"))
- num_threads = atoi (getenv ("CAIRO_TEST_NUM_THREADS"));
- if (num_threads > 1) {
- cairo_test_thread_t *threads;
- size_t n;
-
- threads = xmalloc (sizeof (cairo_test_thread_t) * num_threads);
- for (n = 0; n < num_threads; n++) {
- threads[n].ctx = &ctx;
- threads[n].id = n + 1;
- pthread_create (&threads[n].thread, NULL,
- cairo_test_run_threaded, &threads[n]);
- }
- for (n = 0; n < num_threads; n++) {
- void *tmp;
- pthread_join (threads[n].thread, &tmp);
- if (ret == CAIRO_TEST_SUCCESS)
- ret = (cairo_test_status_t) tmp;
- }
- free (threads);
- }
-
- if (ret == CAIRO_TEST_SUCCESS)
-#endif
- ret = _cairo_test_context_run (&ctx);
-
- if (ret != CAIRO_TEST_SUCCESS)
- printf ("Check %s%s out for more information.\n", ctx.test_name, CAIRO_TEST_LOG_SUFFIX);
-
- cairo_test_fini (&ctx);
-
- return ret;
-}
-
-cairo_test_status_t
-cairo_test (const cairo_test_t *test)
-{
-#ifdef _MSC_VER
- /* We don't want an assert dialog, we want stderr */
- _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
-#endif
-
- return cairo_test_expecting (test);
-}
-
const cairo_test_context_t *
cairo_test_get_context (cairo_t *cr)
{
diff --git a/test/cairo-test.h b/test/cairo-test.h
index dd4fcf9..843d88a 100644
--- a/test/cairo-test.h
+++ b/test/cairo-test.h
@@ -254,10 +254,6 @@ void
cairo_test_logv (const cairo_test_context_t *ctx,
const char *fmt, va_list ap) CAIRO_BOILERPLATE_PRINTF_FORMAT(2, 0);
-void
-cairo_test_log_path (const cairo_test_context_t *ctx,
- const cairo_path_t *path);
-
/* Helper functions that take care of finding source images even when
* building in a non-srcdir manner, (i.e. the tests will be run in a
* directory that is different from the one where the source image
commit 97b219a5e74a30c5cb80dc7012cab8d118dd753a
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Wed Oct 26 17:16:06 2011 +0200
test: Re-enable pass-through
The pass-through test was not updated to the current test conventions
and was not enabled in the Makefiles.
diff --git a/test/Makefile.sources b/test/Makefile.sources
index d6f82a8..8acc266 100644
--- a/test/Makefile.sources
+++ b/test/Makefile.sources
@@ -228,6 +228,7 @@ test_sources = \
paint-with-alpha.c \
partial-clip-text.c \
partial-coverage.c \
+ pass-through.c \
path-append.c \
path-stroke-twice.c \
path-precision.c \
diff --git a/test/pass-through.c b/test/pass-through.c
index 96f91ba..17a38db 100644
--- a/test/pass-through.c
+++ b/test/pass-through.c
@@ -25,15 +25,6 @@
#include "cairo-test.h"
-static cairo_test_draw_function_t draw;
-
-static const cairo_test_t test = {
- "pass-through",
- "Tests pixel values",
- 16, 256,
- draw
-};
-
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
@@ -92,8 +83,9 @@ draw (cairo_t *cr, int width, int height)
return CAIRO_TEST_SUCCESS;
}
-int
-main (void)
-{
- return cairo_test (&test);
-}
+CAIRO_TEST (pass_through,
+ "tests pixel values",
+ "color", /* keywords */
+ NULL, /* requirements */
+ 16, 256,
+ NULL, draw)
commit c8b5d270f6a9f36e14d6e1462dfd589475926be8
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Sun Oct 2 16:50:37 2011 -0700
Improve the documentation of the flags
Some utilities were providing incorrect or incomplete usage
information.
diff --git a/perf/cairo-analyse-trace.c b/perf/cairo-analyse-trace.c
index 6cd77f6..5e0ad70 100644
--- a/perf/cairo-analyse-trace.c
+++ b/perf/cairo-analyse-trace.c
@@ -256,18 +256,17 @@ static void
usage (const char *argv0)
{
fprintf (stderr,
-"Usage: %s [-l] [-r] [-v] [-i iterations] [test-names ... | traces ...]\n"
-" %s -l\n"
+"Usage: %s [-l] [-i iterations] [-x exclude-file] [test-names ... | traces ...]\n"
"\n"
-"Run the cairo performance test suite over the given tests (all by default)\n"
+"Run the cairo trace analysis suite over the given tests (all by default)\n"
"The command-line arguments are interpreted as follows:\n"
"\n"
-" -v verbose\n"
-" -x exclude; specify a file to read a list of traces to exclude\n"
+" -i iterations; specify the number of iterations per test case\n"
" -l list only; just list selected test case names without executing\n"
+" -x exclude; specify a file to read a list of traces to exclude\n"
"\n"
"If test names are given they are used as sub-string matches so a command\n"
-"such as \"cairo-perf-trace firefox\" can be used to run all firefox traces.\n"
+"such as \"%s firefox\" can be used to run all firefox traces.\n"
"Alternatively, you can specify a list of filenames to execute.\n",
argv0, argv0);
}
diff --git a/perf/cairo-perf-micro.c b/perf/cairo-perf-micro.c
index 63aad71..572593b 100644
--- a/perf/cairo-perf-micro.c
+++ b/perf/cairo-perf-micro.c
@@ -315,19 +315,19 @@ static void
usage (const char *argv0)
{
fprintf (stderr,
-"Usage: %s [-l] [-r] [-v] [-i iterations] [test-names ...]\n"
-" %s -l\n"
+"Usage: %s [-flrv] [-i iterations] [test-names ...]\n"
"\n"
"Run the cairo performance test suite over the given tests (all by default)\n"
"The command-line arguments are interpreted as follows:\n"
"\n"
-" -r raw; display each time measurement instead of summary statistics\n"
-" -v verbose; in raw mode also show the summaries\n"
+" -f fast; faster, less accurate\n"
" -i iterations; specify the number of iterations per test case\n"
" -l list only; just list selected test case names without executing\n"
+" -r raw; display each time measurement instead of summary statistics\n"
+" -v verbose; in raw mode also show the summaries\n"
"\n"
"If test names are given they are used as sub-string matches so a command\n"
-"such as \"cairo-perf text\" can be used to run all text test cases.\n",
+"such as \"%s text\" can be used to run all text test cases.\n",
argv0, argv0);
}
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index 3e5ba95..7259f2f 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -354,21 +354,22 @@ static void
usage (const char *argv0)
{
fprintf (stderr,
-"Usage: %s [-l] [-r] [-v] [-i iterations] [test-names ... | traces ...]\n"
-" %s -l\n"
+"Usage: %s [-clrsv] [-i iterations] [-t tile-size] [-x exclude-file] [test-names ... | traces ...]\n"
"\n"
"Run the cairo performance test suite over the given tests (all by default)\n"
"The command-line arguments are interpreted as follows:\n"
"\n"
+" -c use surface cache; keep a cache of surfaces to be reused\n"
+" -i iterations; specify the number of iterations per test case\n"
+" -l list only; just list selected test case names without executing\n"
" -r raw; display each time measurement instead of summary statistics\n"
" -s sync; only sum the elapsed time of the indiviual operations\n"
+" -t tile size; draw to tiled surfaces\n"
" -v verbose; in raw mode also show the summaries\n"
-" -i iterations; specify the number of iterations per test case\n"
-" -x exclude; specify a file to read a list of traces to exclude\n"
-" -l list only; just list selected test case names without executing\n"
+" -x exclude; specify a file to read a list of traces to exclude\n"
"\n"
"If test names are given they are used as sub-string matches so a command\n"
-"such as \"cairo-perf-trace firefox\" can be used to run all firefox traces.\n"
+"such as \"%s firefox\" can be used to run all firefox traces.\n"
"Alternatively, you can specify a list of filenames to execute.\n",
argv0, argv0);
}
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index c0a7e95..6a1fc98 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -341,7 +341,6 @@ usage (const char *argv0)
{
fprintf (stderr,
"Usage: %s [-afkxsl] [test-names|keywords ...]\n"
- " %s -l\n"
"\n"
"Run the cairo conformance test suite over the given tests (all by default)\n"
"The command-line arguments are interpreted as follows:\n"
@@ -350,15 +349,15 @@ usage (const char *argv0)
" skips similar surface and device offset testing.\n"
" -f foreground; do not fork\n"
" -k match tests by keyword\n"
+ " -l list only; just list selected test case names without executing\n"
" -s include slow, long running tests\n"
" -x exit on first failure\n"
- " -l list only; just list selected test case names without executing\n"
"\n"
"If test names are given they are used as matches either to a specific\n"
"test case or to a keyword, so a command such as\n"
- "\"cairo-test-suite -k text\" can be used to run all text test cases, and\n"
- "\"cairo-test-suite text-transform\" to run the individual case.\n",
- argv0, argv0);
+ "\"%s -k text\" can be used to run all text test cases, and\n"
+ "\"%s text-transform\" to run the individual case.\n",
+ argv0, argv0, argv0);
}
static void
diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c
index 89ef651..fdc8a62 100644
--- a/test/cairo-test-trace.c
+++ b/test/cairo-test-trace.c
@@ -1527,17 +1527,16 @@ static void
usage (const char *argv0)
{
fprintf (stderr,
-"Usage: %s [-x exclude-file] [test-names ... | traces ...]\n"
-" %s -l\n"
+"Usage: %s [-l] [-x exclude-file] [test-names ... | traces ...]\n"
"\n"
"Run the cairo test suite over the given traces (all by default).\n"
"The command-line arguments are interpreted as follows:\n"
"\n"
-" -x exclude; specify a file to read a list of traces to exclude\n"
" -l list only; just list selected test case names without executing\n"
+" -x exclude; specify a file to read a list of traces to exclude\n"
"\n"
"If test names are given they are used as sub-string matches so a command\n"
-"such as \"cairo-test-trace firefox\" can be used to run all firefox traces.\n"
+"such as \"%s firefox\" can be used to run all firefox traces.\n"
"Alternatively, you can specify a list of filenames to execute.\n",
argv0, argv0);
}
commit 6a0ba303035997fcd5f28bcd32297f9bc21bd45a
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Sun Oct 2 16:15:59 2011 -0700
Sort option flags
Keep the option flags in alphabetical order. This makes it easier to
check for collisions or missing handlers.
Avoids an internal error when passing flags -c, -r or -v to
cairo-analyse-trace.
diff --git a/perf/cairo-analyse-trace.c b/perf/cairo-analyse-trace.c
index ac2a4e7..6cd77f6 100644
--- a/perf/cairo-analyse-trace.c
+++ b/perf/cairo-analyse-trace.c
@@ -330,7 +330,7 @@ parse_options (cairo_perf_t *perf,
perf->num_exclude_names = 0;
while (1) {
- c = _cairo_getopt (argc, argv, "i:x:lrvc");
+ c = _cairo_getopt (argc, argv, "i:lx:");
if (c == -1)
break;
diff --git a/perf/cairo-perf-micro.c b/perf/cairo-perf-micro.c
index 61ed55f..63aad71 100644
--- a/perf/cairo-perf-micro.c
+++ b/perf/cairo-perf-micro.c
@@ -361,11 +361,16 @@ parse_options (cairo_perf_t *perf,
perf->summary = stdout;
while (1) {
- c = _cairo_getopt (argc, argv, "i:lrvf");
+ c = _cairo_getopt (argc, argv, "fi:lrv");
if (c == -1)
break;
switch (c) {
+ case 'f':
+ perf->fast_and_sloppy = TRUE;
+ if (ms == NULL)
+ perf->ms_per_iteration = CAIRO_PERF_ITERATION_MS_FAST;
+ break;
case 'i':
perf->exact_iterations = TRUE;
perf->iterations = strtoul (optarg, &end, 10);
@@ -382,11 +387,6 @@ parse_options (cairo_perf_t *perf,
perf->raw = TRUE;
perf->summary = NULL;
break;
- case 'f':
- perf->fast_and_sloppy = TRUE;
- if (ms == NULL)
- perf->ms_per_iteration = CAIRO_PERF_ITERATION_MS_FAST;
- break;
case 'v':
verbose = 1;
break;
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index 8e637a7..3e5ba95 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -445,11 +445,14 @@ parse_options (cairo_perf_t *perf,
perf->num_exclude_names = 0;
while (1) {
- c = _cairo_getopt (argc, argv, "t:i:x:lsrvc");
+ c = _cairo_getopt (argc, argv, "ci:lrst:vx:");
if (c == -1)
break;
switch (c) {
+ case 'c':
+ use_surface_cache = 1;
+ break;
case 'i':
perf->exact_iterations = TRUE;
perf->iterations = strtoul (optarg, &end, 10);
@@ -459,14 +462,6 @@ parse_options (cairo_perf_t *perf,
exit (1);
}
break;
- case 't':
- perf->tile_size = strtoul (optarg, &end, 10);
- if (*end != '\0') {
- fprintf (stderr, "Invalid argument for -t (not an integer): %s\n",
- optarg);
- exit (1);
- }
- break;
case 'l':
perf->list_only = TRUE;
break;
@@ -477,12 +472,17 @@ parse_options (cairo_perf_t *perf,
case 's':
perf->observe = TRUE;
break;
+ case 't':
+ perf->tile_size = strtoul (optarg, &end, 10);
+ if (*end != '\0') {
+ fprintf (stderr, "Invalid argument for -t (not an integer): %s\n",
+ optarg);
+ exit (1);
+ }
+ break;
case 'v':
verbose = 1;
break;
- case 'c':
- use_surface_cache = 1;
- break;
case 'x':
if (! read_excludes (perf, optarg)) {
fprintf (stderr, "Invalid argument for -x (not readable file): %s\n",
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index 28e4b5d..c0a7e95 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -367,7 +367,7 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[])
int c;
while (1) {
- c = _cairo_getopt (*argc, *argv, ":afkxsl");
+ c = _cairo_getopt (*argc, *argv, ":afklsx");
if (c == -1)
break;
@@ -375,21 +375,21 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[])
case 'a':
runner->full_test = TRUE;
break;
- case 's':
- runner->slow = TRUE;
+ case 'f':
+ runner->foreground = TRUE;
+ break;
+ case 'k':
+ runner->keyword_match = TRUE;
break;
case 'l':
runner->list_only = TRUE;
break;
- case 'f':
- runner->foreground = TRUE;
+ case 's':
+ runner->slow = TRUE;
break;
case 'x':
runner->exit_on_failure = TRUE;
break;
- case 'k':
- runner->keyword_match = TRUE;
- break;
default:
fprintf (stderr, "Internal error: unhandled option: %c\n", c);
/* fall-through */
diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c
index fb1bd42..89ef651 100644
--- a/test/cairo-test-trace.c
+++ b/test/cairo-test-trace.c
@@ -1554,7 +1554,7 @@ parse_options (test_trace_t *test, int argc, char *argv[])
test->num_exclude_names = 0;
while (1) {
- c = _cairo_getopt (argc, argv, "x:l");
+ c = _cairo_getopt (argc, argv, "lx:");
if (c == -1)
break;
More information about the cairo-commit
mailing list