summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-02-17 12:37:07 -0800
committerEric Anholt <eric@anholt.net>2010-02-17 12:56:58 -0800
commit9057c4b6be5f5cc6f8905e017dde534402ddedda (patch)
tree78203ba59842f643fa91b61a6c04f6b3017b756a
parente0a948bd2ff3504f5d8b3b3f2136cd9b86cf8ec6 (diff)
test: Add an option to explicitly specify a test name to the runner.
-rw-r--r--test/cairo-test-runner.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index af2991a2..2b83b886 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -93,6 +93,7 @@ typedef struct _cairo_test_runner {
cairo_bool_t exit_on_failure;
cairo_bool_t list_only;
cairo_bool_t full_test;
+ cairo_bool_t exact_test_names;
} cairo_test_runner_t;
typedef enum {
@@ -315,7 +316,7 @@ static void
usage (const char *argv0)
{
fprintf (stderr,
- "Usage: %s [-afx] [test-names|keywords ...]\n"
+ "Usage: %s [-afxlt] [test-names|keywords ...]\n"
" %s -l\n"
"\n"
"Run the cairo conformance test suite over the given tests (all by default)\n"
@@ -324,10 +325,11 @@ usage (const char *argv0)
" -a all; run the full set of tests. By default the test suite\n"
" skips similar surface and device offset testing.\n"
" -f foreground; do not fork\n"
+ " -t exact test names, no keyword matching\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 exact matches either to a specific\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 text\" can be used to run all text test cases.\n",
argv0, argv0);
@@ -339,7 +341,7 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[])
int c;
while (1) {
- c = _cairo_getopt (*argc, *argv, ":aflx");
+ c = _cairo_getopt (*argc, *argv, ":aflxt");
if (c == -1)
break;
@@ -356,6 +358,9 @@ _parse_cmdline (cairo_test_runner_t *runner, int *argc, char **argv[])
case 'x':
runner->exit_on_failure = TRUE;
break;
+ case 't':
+ runner->exact_test_names = TRUE;
+ break;
default:
fprintf (stderr, "Internal error: unhandled option: %c\n", c);
/* fall-through */
@@ -709,6 +714,9 @@ main (int argc, char **argv)
found = TRUE;
}
+ if (runner.exact_test_names)
+ continue;
+
/* XXX keyword match */
if (keywords != NULL && strstr (keywords, match) != NULL) {
found = ! invert;