X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftap%2Ftap.h;h=06978e29c33aec3ba7b99bb96a868954fe7c2b28;hp=395d245d284a55dab9b8df064d9d58dddda8d363;hb=532feb88f516f0848ae0e3eaf3a89a1fc94db6c4;hpb=a40b318e7a07a452ae7456053727bd11b2fa49b4 diff --git a/ccan/tap/tap.h b/ccan/tap/tap.h index 395d245d..06978e29 100644 --- a/ccan/tap/tap.h +++ b/ccan/tap/tap.h @@ -1,3 +1,5 @@ +#ifndef CCAN_TAP_H +#define CCAN_TAP_H /*- * Copyright (c) 2004 Nik Clayton * All rights reserved. @@ -89,7 +91,7 @@ void plan_tests(unsigned int tests); * int x = somefunc(); * if (x > 0) * pass("somefunc() returned a valid value"); - * else + * else * fail("somefunc() returned an invalid value"); */ # define pass(...) ok(1, __VA_ARGS__) @@ -167,7 +169,7 @@ void skip(unsigned int n, const char *fmt, ...) PRINTF_FMT(2, 3); * This way, should a test start to succeed unexpectedly, tools like prove(1) * will indicate this and you can move the test out of the todo block. This * is much more useful than simply commenting out (or '#if 0') the tests. - * + * * From the Test::More documentation: * If it's something the programmer hasn't done yet, use TODO. This is for * any code you haven't written yet, or bugs you have yet to fix, but want to @@ -195,7 +197,7 @@ void todo_end(void); /** * exit_status - the value that main should return. * - * For maximum compatability your test program should return a particular exit + * For maximum compatibility your test program should return a particular exit * code (ie. 0 if all tests were run, and every test which was expected to * succeed succeeded). * @@ -243,4 +245,12 @@ void plan_no_plan(void); */ void plan_skip_all(const char *reason); +/** + * tap_fail_callback - function to call when we fail + * + * This can be used to ease debugging, or exit on the first failure. + */ +void (*tap_fail_callback)(void); + #endif /* C99 or gcc */ +#endif /* CCAN_TAP_H */