diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-04-17 06:58:18 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-04-17 06:58:18 +0000 |
commit | b346038724c827ed487653d35a1ed1a05d10fc67 (patch) | |
tree | 262053ee39faf5d3b8551290187945fbc7643439 /test/tinytest.c | |
parent | 2c4c294ed8168c3d9bea99d02896235cd8d7385f (diff) | |
download | libevent-b346038724c827ed487653d35a1ed1a05d10fc67.tar.gz |
Even _more_ recent tinytest, designed to give better help output.release-2.0.1-alpha
svn:r1192
Diffstat (limited to 'test/tinytest.c')
-rw-r--r-- | test/tinytest.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/tinytest.c b/test/tinytest.c index dbfc098b..b07d4d9b 100644 --- a/test/tinytest.c +++ b/test/tinytest.c @@ -258,11 +258,15 @@ _tinytest_set_flag(struct testgroup_t *groups, const char *arg, unsigned long fl } static void -usage(struct testgroup_t *groups) +usage(struct testgroup_t *groups, int list_groups) { puts("Options are: [--verbose|--quiet|--terse] [--no-fork]"); - puts("Known tests are:"); - _tinytest_set_flag(groups, "..", 0); + puts(" Specify tests by name, or using a prefix ending with '..'"); + puts(" Use --list-tests for a list of tests."); + if (list_groups) { + puts("Known tests are:"); + _tinytest_set_flag(groups, "..", 0); + } exit(0); } @@ -290,7 +294,9 @@ tinytest_main(int c, const char **v, struct testgroup_t *groups) opt_verbosity = 0; verbosity_flag = "--terse"; } else if (!strcmp(v[i], "--help")) { - usage(groups); + usage(groups, 0); + } else if (!strcmp(v[i], "--list-tests")) { + usage(groups, 1); } else { printf("Unknown option %s. Try --help\n",v[i]); return -1; |