[PATCH wayland] tests: rename NO_ASSERT_LEAK_CHECK

Bryce Harrington bryce at osg.samsung.com
Thu Nov 20 14:59:55 PST 2014


On Wed, Nov 19, 2014 at 12:00:10PM +0100, Marek Chalupa wrote:
> This env variable is used for turning off the leak checks in tests.
> Rename it to WAYLAND_TESTS_NO_LEAK_CHECK, so that it is consistent
> with WAYLAND_TESTS_NO_TIMEOUTS.

Should these both be 'WAYLAND_TEST_'?  In weston there is already a
WESTON_TEST_CLIENT_PATH.

If WAYLAND_TESTS_* is better, then maybe WESTON_TEST_CLIENT_PATH should
be changed for consistency.

Apart from that, LGTM.

Reviewed-by: Bryce Harrington <b.harrington at samsung.com>

> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> ---
>  tests/test-runner.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/test-runner.c b/tests/test-runner.c
> index 09c50e2..a6c75a9 100644
> --- a/tests/test-runner.c
> +++ b/tests/test-runner.c
> @@ -42,6 +42,9 @@ static void (*sys_free)(void*);
>  static void* (*sys_realloc)(void*, size_t);
>  static void* (*sys_calloc)(size_t, size_t);
>  
> +/* when set to 1, check if tests are not leaking memory and opened files.
> + * It is turned on by default. It can be turned off by
> + * WAYLAND_TESTS_NO_LEAK_CHECK environment variable. */
>  int leak_check_enabled;
>  
>  /* when this var is set to 0, every call to test_set_timeout() is
> @@ -234,7 +237,7 @@ int main(int argc, char *argv[])
>  	sys_malloc = dlsym(RTLD_NEXT, "malloc");
>  	sys_free = dlsym(RTLD_NEXT, "free");
>  
> -	leak_check_enabled = !getenv("NO_ASSERT_LEAK_CHECK");
> +	leak_check_enabled = !getenv("WAYLAND_TESTS_NO_LEAK_CHECK");
>  	timeouts_enabled = !getenv("WAYLAND_TESTS_NO_TIMEOUTS");
>  
>  	if (argc == 2 && strcmp(argv[1], "--help") == 0)
> -- 
> 2.1.0
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list