summaryrefslogtreecommitdiff
path: root/test/abts.c
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2004-06-05 19:20:12 +0000
committerRyan Bloom <rbb@apache.org>2004-06-05 19:20:12 +0000
commitf7502b6a5ac05d724061b8600d04f981d6136e4b (patch)
treeeeef35eebd5fe843730e121f6e5af2fed5101970 /test/abts.c
parentce45c39826c7bad165c313da5f408524c63b4f6d (diff)
downloadapr-f7502b6a5ac05d724061b8600d04f981d6136e4b.tar.gz
Add back the -l option to the apr test suite. This allows the test suite
to list all available tests. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/abts.c')
-rw-r--r--test/abts.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/abts.c b/test/abts.c
index edc99e276..b8e594e37 100644
--- a/test/abts.c
+++ b/test/abts.c
@@ -26,6 +26,7 @@ static int curr_char;
static int verbose = 0;
static int exclude = 0;
static int quiet = 0;
+static int list_tests = 0;
const char **testlist = NULL;
@@ -42,6 +43,9 @@ static int find_test_name(const char *testname) {
/* Determine if the test should be run at all */
static int should_test_run(const char *testname) {
int found = 0;
+ if (list_tests == 1) {
+ return 0;
+ }
if (testlist == NULL) {
return 1;
}
@@ -101,7 +105,8 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full)
subsuite->num_test = 0;
subsuite->failed = 0;
subsuite->next = NULL;
- /* suite_name_full may be an absolute path depending on __FILE__ expansion */
+ /* suite_name_full may be an absolute path depending on __FILE__
+ * expansion */
suite_name = strrchr(suite_name_full, '/');
if (suite_name) {
suite_name++;
@@ -109,11 +114,18 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full)
suite_name = suite_name_full;
}
p = strrchr(suite_name, '.');
- if (p)
+ if (p) {
subsuite->name = memcpy(calloc(p - suite_name + 1, 1),
suite_name, p - suite_name);
- else
+ }
+ else {
subsuite->name = suite_name;
+ }
+
+ if (list_tests) {
+ fprintf(stdout, "%s\n", subsuite->name);
+ }
+
subsuite->not_run = 0;
if (suite == NULL) {
@@ -363,7 +375,7 @@ int main(int argc, const char *const argv[]) {
continue;
}
if (!strcmp(argv[i], "-l")) {
- /* print the list. */
+ list_tests = 1;
continue;
}
if (!strcmp(argv[i], "-q")) {