[PATCH wayland 2/4] tests: add timeout test

Marek Chalupa mchqwerty at gmail.com
Wed Sep 24 05:37:06 PDT 2014


sanity test if timeouts work.

Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
---
 tests/sanity-test.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/tests/sanity-test.c b/tests/sanity-test.c
index 46f4f85..5a03e7c 100644
--- a/tests/sanity-test.c
+++ b/tests/sanity-test.c
@@ -29,6 +29,9 @@
 #include "test-runner.h"
 #include "wayland-util.h"
 
+#define WL_HIDE_DEPRECATED
+#include "test-compositor.h"
+
 extern int leak_check_enabled;
 
 TEST(empty)
@@ -125,3 +128,25 @@ TEST(sanity_fd_exec)
 
 	exec_fd_leak_check(nr_fds + 2);
 }
+
+FAIL_TEST(timeout_tst)
+{
+	test_set_timeout(1);
+	sleep(2);
+}
+
+static void
+client_timeout(void)
+{
+	test_set_timeout(1);
+	sleep(2);
+}
+
+/* test timeout with test-compositor */
+FAIL_TEST(tc_timeout_tst)
+{
+	struct display *d = display_create();
+	client_create(d, client_timeout);
+	display_run(d);
+	display_destroy(d);
+}
-- 
1.9.3



More information about the wayland-devel mailing list