]> git.ozlabs.org Git - ccan/blobdiff - ccan/failtest/failtest.h
failtest: plug memory leak.
[ccan] / ccan / failtest / failtest.h
index 1aa921813bf7af6c433ab1f6e46ebfe6032b91b7..9cabd1a9a712d1ac2bb0c559e41a024b136f1f38 100644 (file)
@@ -1,5 +1,7 @@
+/* Licensed under LGPL - see LICENSE file for details */
 #ifndef CCAN_FAILTEST_H
 #define CCAN_FAILTEST_H
+#include "config.h"
 #include <sys/types.h>
 #include <stdbool.h>
 #include <fcntl.h>
@@ -195,6 +197,16 @@ extern enum failtest_result
 extern bool (*failtest_exit_check)(struct failtest_call *history,
                                   unsigned num);
 
+/**
+ * failtest_has_failed - determine if a failure has occurred.
+ *
+ * Sometimes you want to exit immediately if you've experienced a failure.
+ * This is useful when you have four separate tests in your test suite,
+ * and you don't want to do the next one if you've had a failure in a
+ * previous one.
+ */
+extern bool failtest_has_failed(void);
+
 /**
  * failtest_timeout_ms - how long to wait before killing child.
  *