diff options
author | Justin Erenkrantz <jerenkrantz@apache.org> | 2004-06-04 08:44:15 +0000 |
---|---|---|
committer | Justin Erenkrantz <jerenkrantz@apache.org> | 2004-06-04 08:44:15 +0000 |
commit | cc7a365f53eb858c6d1056f358f6e5e0fe37a8bd (patch) | |
tree | 6236288b403d01d51b7461fa722dd8c14c7861e7 /test/abts.c | |
parent | a548c13fe173659e7375b78e7cb7885fe91ddcc3 (diff) | |
download | apr-cc7a365f53eb858c6d1056f358f6e5e0fe37a8bd.tar.gz |
Various test suite improvements to actually test the global mutex code with all
of the available methods.
abts.c: Properly strip prefix and .c extension (was broken if . character is
in your path!); specify 'testfoo' rather than 'path/to/testfoo' now
globalmutexchild.c: Pass along the mutex mechanism to the child via args[1].
testglobalmutex.c: Invoke test for every global mutex method available.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65148 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/abts.c')
-rw-r--r-- | test/abts.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/abts.c b/test/abts.c index 602d12cf1..f4f69d53a 100644 --- a/test/abts.c +++ b/test/abts.c @@ -85,10 +85,11 @@ static void end_suite(abts_suite *suite) } } -abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) +abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full) { sub_suite *subsuite; char *p; + const char *suite_name; curr_char = 0; /* Only end the suite if we actually ran it */ @@ -100,7 +101,12 @@ abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name) subsuite->num_test = 0; subsuite->failed = 0; subsuite->next = NULL; - p = strchr(suite_name, '.'); + /* suite_name_full is the complete path of the source code; strip out. */ + suite_name = strrchr(suite_name_full, '/') + 1; + if (!suite_name) { + suite_name = suite_name_full; + } + p = strrchr(suite_name, '.'); if (p) subsuite->name = memcpy(calloc(p - suite_name + 1, 1), suite_name, p - suite_name); |