X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Futils%2Ftap.c;h=6acab66c841aea101d8e247cba60ef9a33101af7;hp=8bf72f6fcde57dac97fd9673cb0df5efdf9b6b0c;hb=1a186a881c195c0f240c0baa813056b0cc1eab91;hpb=1b3874915095deab4aa9be0f33423e992e571bb7 diff --git a/tests/utils/tap.c b/tests/utils/tap.c index 8bf72f6..6acab66 100644 --- a/tests/utils/tap.c +++ b/tests/utils/tap.c @@ -42,6 +42,7 @@ static char *todo_msg = NULL; static char *todo_msg_fixed = "libtap malloc issue"; static int todo = 0; static int test_died = 0; +static int tap_is_disabled = 0; /* Encapsulate the pthread code in a conditional. In the absence of libpthread the code does nothing */ @@ -284,6 +285,32 @@ diag(char *fmt, ...) return 0; } +unsigned int +rdiag_start(void) +{ + fputs("# ", stderr); + return 0; +} + +unsigned int +rdiag(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + return 0; +} + +unsigned int +rdiag_end(void) +{ + fputs("\n", stderr); + return 0; +} + void _expected_tests(unsigned int tests) { @@ -389,6 +416,11 @@ _cleanup(void) LOCK; + if (tap_is_disabled) { + UNLOCK; + return; + } + /* If plan_no_plan() wasn't called, and we don't have a plan, and we're not skipping everything, then something happened before we could produce any output */ @@ -431,3 +463,12 @@ _cleanup(void) UNLOCK; } + +/* Disable tap for this process. */ +void +tap_disable(void) +{ + LOCK; + tap_is_disabled = 1; + UNLOCK; +}