]> git.ozlabs.org Git - ccan/blobdiff - ccan/tap/tap.c
tap: add fail callback
[ccan] / ccan / tap / tap.c
index a5156aa194a748ecdf8822d49fde91ce7a0a257f..106da912487ba28665fc82d9f206e4c639085a34 100644 (file)
@@ -179,6 +179,9 @@ _gen_result(int ok, const char *func, const char *file, unsigned int line,
 
        UNLOCK;
 
+       if (!ok && tap_fail_callback)
+               tap_fail_callback();
+
        /* We only care (when testing) that ok is positive, but here we
           specifically only want to return 1 or 0 */
        return ok ? 1 : 0;
@@ -260,7 +263,7 @@ _tap_init(void)
                /* stdout needs to be unbuffered so that the output appears
                   in the same place relative to stderr output as it does 
                   with Test::Harness */
-               setbuf(stdout, 0);
+//             setbuf(stdout, 0);
                run_once = 1;
        }
 }