aboutsummaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-05-14 19:47:43 -0400
committerNick Mathewson <nickm@torproject.org>2019-05-15 07:50:56 -0400
commite4feb4ad01e7f3de592adbecd7f1ffae040f51ed (patch)
treee56f93fbb338c1829ae58da81439f52098ed7e88 /src/ext
parentf664c0c31885eac5d36298772d4ecf2e10a10021 (diff)
downloadtor-e4feb4ad01e7f3de592adbecd7f1ffae040f51ed.tar.gz
tor-e4feb4ad01e7f3de592adbecd7f1ffae040f51ed.zip
Give tinytest a function to say whether the current test has failed
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/tinytest.c6
-rw-r--r--src/ext/tinytest.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ext/tinytest.c b/src/ext/tinytest.c
index 16f11e4639..239fdd0a38 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 ed07b26bc0..05c2fda052 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. */