summaryrefslogtreecommitdiff
path: root/src/test/testing_common.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-09-08 13:27:30 -0400
committerNick Mathewson <nickm@torproject.org>2016-09-08 13:27:30 -0400
commit3269307dafafa8c7c2c3e0be5d5c3cb5e7df3153 (patch)
treec44e2b743f72efa5eca1009675d0aac047310c7e /src/test/testing_common.c
parent6a1454aa462c7a1ef8d84fe703d4f28e727ca1c0 (diff)
downloadtor-3269307dafafa8c7c2c3e0be5d5c3cb5e7df3153.tar.gz
tor-3269307dafafa8c7c2c3e0be5d5c3cb5e7df3153.zip
Treat all nonfatal assertion failures as unit test failures.
Part of 19999.
Diffstat (limited to 'src/test/testing_common.c')
-rw-r--r--src/test/testing_common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index 6460713f75..29f36a3da6 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -217,6 +217,12 @@ const struct testcase_setup_t passthrough_setup = {
passthrough_test_setup, passthrough_test_cleanup
};
+static void
+an_assertion_failed(void)
+{
+ tinytest_set_test_failed_();
+}
+
/** Main entry point for unit test code: parse the command line, and run
* some unit tests. */
int
@@ -299,6 +305,7 @@ main(int c, const char **v)
tor_free(errmsg);
return 1;
}
+ tor_set_failed_assertion_callback(an_assertion_failed);
atexit(remove_directory);