]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Give tinytest a function to say whether the current test has failed
authorNick Mathewson <nickm@torproject.org>
Tue, 14 May 2019 23:47:43 +0000 (19:47 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 15 May 2019 11:50:56 +0000 (07:50 -0400)
src/ext/tinytest.c
src/ext/tinytest.h

index 16f11e4639ab136df1dcd955e04a296aefcec1e0..239fdd0a3818b7ecd6ceab78a1318f7fdc26ab8c 100644 (file)
@@ -492,6 +492,12 @@ tinytest_set_test_skipped_(void)
                cur_test_outcome = SKIP;
 }
 
+int
+tinytest_cur_test_has_failed(void)
+{
+       return (cur_test_outcome == FAIL);
+}
+
 char *
 tinytest_format_hex_(const void *val_, unsigned long len)
 {
index ed07b26bc006bd6f3c00ced89c0ba90198203466..05c2fda0526c2b660c3b1bbc1047a87df09c8204 100644 (file)
@@ -72,6 +72,9 @@ struct testlist_alias_t {
 };
 #define END_OF_ALIASES { NULL, NULL }
 
+/** Return true iff the current test has failed. */
+int tinytest_cur_test_has_failed(void);
+
 /** Implementation: called from a test to indicate failure, before logging. */
 void tinytest_set_test_failed_(void);
 /** Implementation: called from a test to indicate that we're skipping. */