aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests/test-lib.c
diff options
context:
space:
mode:
Diffstat (limited to 't/unit-tests/test-lib.c')
-rw-r--r--t/unit-tests/test-lib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/unit-tests/test-lib.c b/t/unit-tests/test-lib.c
index 3c513ce59a..989dc758e6 100644
--- a/t/unit-tests/test-lib.c
+++ b/t/unit-tests/test-lib.c
@@ -264,7 +264,12 @@ static void test_todo(void)
int test_assert(const char *location, const char *check, int ok)
{
- assert(ctx.running);
+ if (!ctx.running) {
+ test_msg("BUG: check outside of test at %s",
+ make_relative(location));
+ ctx.failed = 1;
+ return 0;
+ }
if (ctx.result == RESULT_SKIP) {
test_msg("skipping check '%s' at %s", check,