[PATCH wayland v2] tests: rename env vars for tests

Marek Chalupa mchqwerty at gmail.com
Fri Nov 28 00:41:50 PST 2014


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 at 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);
-- 
2.1.0



More information about the wayland-devel mailing list