From 7f91c4953ccfbb96d76ecd73715fa2e524be933e Mon Sep 17 00:00:00 2001 From: M Joonas Pihlaja Date: Sat, 5 Sep 2009 05:07:25 +0300 Subject: [PATCH] [boilerplate] Support wildcard ? in CAIRO_TEST_TARGET{,_EXCLUDE}. Useful for running tests only for a given content type. --- boilerplate/cairo-boilerplate.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c index e681108b4..46bb05740 100644 --- a/boilerplate/cairo-boilerplate.c +++ b/boilerplate/cairo-boilerplate.c @@ -392,10 +392,12 @@ _cairo_boilerplate_target_matches_name (const cairo_boilerplate_target_t *target name_len = end - tname; /* Check name. */ - if (0 != strncmp (target->name, tname, name_len)) /* exact match? */ - return FALSE; - if (isalnum (target->name[name_len])) - return FALSE; + if (! (name_len == 1 && 0 == strncmp (tname, "?", 1))) { /* wildcard? */ + if (0 != strncmp (target->name, tname, name_len)) /* exact match? */ + return FALSE; + if (isalnum (target->name[name_len])) + return FALSE; + } /* Check optional content. */ if (content_start == NULL) /* none given? */