commit e4feb4ad01e7f3de592adbecd7f1ffae040f51ed Author: Nick Mathewson nickm@torproject.org Date: Tue May 14 19:47:43 2019 -0400
Give tinytest a function to say whether the current test has failed --- src/ext/tinytest.c | 6 ++++++ src/ext/tinytest.h | 3 +++ 2 files changed, 9 insertions(+)
diff --git a/src/ext/tinytest.c b/src/ext/tinytest.c index 16f11e463..239fdd0a3 100644 --- a/src/ext/tinytest.c +++ b/src/ext/tinytest.c @@ -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) { diff --git a/src/ext/tinytest.h b/src/ext/tinytest.h index ed07b26bc..05c2fda05 100644 --- a/src/ext/tinytest.h +++ b/src/ext/tinytest.h @@ -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. */
tor-commits@lists.torproject.org