[PATCH] tests: Allow disabling leak checking assertions by env

Rob Bradford rob at robster.org.uk
Thu Aug 9 02:32:58 PDT 2012


From: Rob Bradford <rob at linux.intel.com>

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 63ce384..6c30649 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);
 }
 
-- 
1.7.11.2



More information about the wayland-devel mailing list