From c95c2dffb0a37ae50350319c52b30629c32f6660 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 16 Aug 2012 18:12:04 -0700 Subject: [PATCH] tests: Allow disabling leak checking assertions by env Some code coverage tools trigger these assertions when run against the test suite since they don't free all their memory. --- tests/test-runner.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test-runner.c b/tests/test-runner.c index 63ce3843..6c30649a 100644 --- a/tests/test-runner.c +++ b/tests/test-runner.c @@ -95,8 +95,10 @@ run_test(const struct test *t) cur_fds = count_open_fds(); t->run(); - assert(cur_alloc == num_alloc && "memory leak detected in test."); - assert(cur_fds == count_open_fds() && "fd leak detected"); + if (!getenv("NO_ASSERT_LEAK_CHECK")) { + assert(cur_alloc == num_alloc && "memory leak detected in test."); + assert(cur_fds == count_open_fds() && "fd leak detected"); + } exit(EXIT_SUCCESS); }