[v2] tests: rename env vars for tests

Submitted by Marek Chalupa on Nov. 28, 2014, 8:41 a.m.

Details

Message ID 1417164110-16737-1-git-send-email-mchqwerty@gmail.com
State Accepted
Commit bef2948348748d1144b2b620fb8fb4bcdd5c0e02
Headers show

Not browsing as part of any series.

Commit Message

Marek Chalupa Nov. 28, 2014, 8:41 a.m.
Rename WAYLAND_TESTS_NO_TIMEOUTS to WAYLAND_TEST_NO_TIMEOUTS.
Further rename NO_ASSERT_LEAK_CHECK to WAYLAND_TEST_NO_LEAK_CHECK.
Now the naming is consistent not only here, in Wayland, but even with
naming of weston env varibles related to testing.

This is version 2 of the patch. The first version just renamed
NO_ASSERT_LEAK_CHECK to WAYLAND_TEST_NO_LEAK_CHECK.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
---
 tests/test-runner.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/test-runner.c b/tests/test-runner.c
index d965a43..67763b3 100644
--- a/tests/test-runner.c
+++ b/tests/test-runner.c
@@ -42,11 +42,14 @@  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_TEST_NO_LEAK_CHECK environment variable. */
 int leak_check_enabled;
 
 /* when this var is set to 0, every call to test_set_timeout() is
  * suppressed - handy when debugging the test. Can be set by
- * WAYLAND_TESTS_NO_TIMEOUTS evnironment var */
+ * WAYLAND_TEST_NO_TIMEOUTS evnironment var */
 static int timeouts_enabled = 1;
 
 extern const struct test __start_test_section, __stop_test_section;
@@ -234,8 +237,8 @@  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");
-	timeouts_enabled = !getenv("WAYLAND_TESTS_NO_TIMEOUTS");
+	leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK");
+	timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS");
 
 	if (argc == 2 && strcmp(argv[1], "--help") == 0)
 		usage(argv[0], EXIT_SUCCESS);

Comments

On Fri, 28 Nov 2014 09:41:50 +0100
Marek Chalupa <mchqwerty@gmail.com> wrote:

> Rename WAYLAND_TESTS_NO_TIMEOUTS to WAYLAND_TEST_NO_TIMEOUTS.
> Further rename NO_ASSERT_LEAK_CHECK to WAYLAND_TEST_NO_LEAK_CHECK.
> Now the naming is consistent not only here, in Wayland, but even with
> naming of weston env varibles related to testing.
> 
> This is version 2 of the patch. The first version just renamed
> NO_ASSERT_LEAK_CHECK to WAYLAND_TEST_NO_LEAK_CHECK.
> 
> Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
> ---
>  tests/test-runner.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/test-runner.c b/tests/test-runner.c
> index d965a43..67763b3 100644
> --- a/tests/test-runner.c
> +++ b/tests/test-runner.c
> @@ -42,11 +42,14 @@ 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_TEST_NO_LEAK_CHECK environment variable. */
>  int leak_check_enabled;
>  
>  /* when this var is set to 0, every call to test_set_timeout() is
>   * suppressed - handy when debugging the test. Can be set by
> - * WAYLAND_TESTS_NO_TIMEOUTS evnironment var */
> + * WAYLAND_TEST_NO_TIMEOUTS evnironment var */
>  static int timeouts_enabled = 1;
>  
>  extern const struct test __start_test_section, __stop_test_section;
> @@ -234,8 +237,8 @@ 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");
> -	timeouts_enabled = !getenv("WAYLAND_TESTS_NO_TIMEOUTS");
> +	leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK");
> +	timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS");
>  
>  	if (argc == 2 && strcmp(argv[1], "--help") == 0)
>  		usage(argv[0], EXIT_SUCCESS);

Pushed.

Thanks,
pq