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.
This commit is contained in:
Rob Bradford 2012-08-16 18:12:04 -07:00 committed by Kristian Høgsberg
parent 7d3ccec18e
commit c95c2dffb0

View file

@ -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);
}