Commit 7205032d authored by Pekka Pessi's avatar Pekka Pessi

s2check.h: redefine tcase_add_loop_test, too

Ignore-this: 149c19e8d089b60e8ddcb98da54c9d88

darcs-hash:20090305174415-db55f-3ba631fb7fec7bd2ac81e165f33431354e6b166b.gz
parent 28da13fb
......@@ -42,10 +42,16 @@
SOFIA_BEGIN_DECLS
#undef tcase_add_test
#undef tcase_add_loop_test
/* Redirect tcase_add_test() to our function */
#define tcase_add_test(tc, tf) s2_tcase_add_test(tc, tf, "" #tf "")
#define tcase_add_test(tc, tf) s2_tcase_add_test(tc, tf, "" #tf "", 0, 0, 1)
void s2_tcase_add_test(TCase *, TFun, char const *name,
int signo, int start, int end);
void s2_tcase_add_test(TCase *, TFun, char const *name);
#define tcase_add_loop_test(tc, tf, s, e) \
s2_tcase_add_test(tc, tf, "" #tf "", 0, (s), (e))
void s2_select_tests(char const *pattern);
......
......@@ -46,7 +46,8 @@ static char const * const *test_patterns = default_patterns;
* A special version of tcase_add_test() that inserts test function into
* tcase only if its name matches given pattern.
*/
void s2_tcase_add_test(TCase *tc, TFun tf, char const *name)
void s2_tcase_add_test(TCase *tc, TFun tf, char const *name,
int signo, int start, int end)
{
char const * const *patterns;
......@@ -54,9 +55,9 @@ void s2_tcase_add_test(TCase *tc, TFun tf, char const *name)
for (patterns = test_patterns; *patterns; patterns++) {
if (!fnmatch(*patterns, name, 0)) {
if (strcmp(*patterns, "*")) {
printf("%s: running\n", name);
printf("%s: selected\n", name);
}
_tcase_add_test(tc, tf, name, 0, 0, 1);
_tcase_add_test(tc, tf, name, signo, start, end);
return;
}
}
......@@ -64,9 +65,9 @@ void s2_tcase_add_test(TCase *tc, TFun tf, char const *name)
for (patterns = test_patterns; *patterns; patterns++) {
if (!strcmp(*patterns, name) || !strcmp(*patterns, "*")) {
if (strcmp(*patterns, "*")) {
printf("%s: running\n", name);
printf("%s: selected\n", name);
}
_tcase_add_test(tc, tf, name, 0, 0, 1);
_tcase_add_test(tc, tf, name, signo, start, end);
return;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment