]> git.ozlabs.org Git - ccan/blobdiff - ccan/tap/tap.h
compiler, talloc, tap, tdb2: use #if instead of #ifdef.
[ccan] / ccan / tap / tap.h
index 46f0779e782b117389c07f7781543b5a14c92fd8..2c309740f9286e8d6d72c514f656ff799025524a 100644 (file)
@@ -118,7 +118,7 @@ void plan_tests(unsigned int tests);
 # define skip_end } while(0)
 
 unsigned int _gen_result(int, const char *, const char *, unsigned int,
-   const char *, ...) PRINTF_ATTRIBUTE(5, 6);
+   const char *, ...) PRINTF_FMT(5, 6);
 
 /**
  * diag - print a diagnostic message (use instead of printf/fprintf)
@@ -130,7 +130,7 @@ unsigned int _gen_result(int, const char *, const char *, unsigned int,
  * Example:
  *     diag("Now running complex tests");
  */
-void diag(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
+void diag(const char *fmt, ...) PRINTF_FMT(1, 2);
 
 /**
  * skip - print a diagnostic message (use instead of printf/fprintf)
@@ -153,7 +153,7 @@ void diag(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
  *     skip(1, "Don't have SOME_FEATURE");
  *     #endif
  */
-void skip(unsigned int n, const char *fmt, ...) PRINTF_ATTRIBUTE(2, 3);
+void skip(unsigned int n, const char *fmt, ...) PRINTF_FMT(2, 3);
 
 /**
  * todo_start - mark tests that you expect to fail.
@@ -183,7 +183,7 @@ void skip(unsigned int n, const char *fmt, ...) PRINTF_ATTRIBUTE(2, 3);
  *     ok(dwim(), "Did what the user wanted");
  *     todo_end();
  */
-void todo_start(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
+void todo_start(const char *fmt, ...) PRINTF_FMT(1, 2);
 
 /**
  * todo_end - end of tests you expect to fail.
@@ -195,7 +195,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 +243,11 @@ 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 */