[PATCH weston] tests: Skip Xwayland test if binary isn't available

Peter Hutterer peter.hutterer at who-t.net
Wed Nov 30 06:05:00 UTC 2016


On Tue, Nov 29, 2016 at 11:06:15AM +0000, Daniel Stone wrote:
> We know we're not going to succeed if the binary isn't installed, so
> skip the test in that case.
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  Makefile.am           | 3 ++-
>  tests/xwayland-test.c | 3 +++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 4f8c837..4463fe0 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1354,7 +1354,8 @@ endif
>  if ENABLE_XWAYLAND_TEST
>  weston_tests +=	xwayland-test.weston
>  xwayland_test_weston_SOURCES = tests/xwayland-test.c
> -xwayland_test_weston_CFLAGS = $(AM_CFLAGS) $(XWAYLAND_TEST_CFLAGS)
> +xwayland_test_weston_CFLAGS = \
> +	$(AM_CFLAGS) $(XWAYLAND_TEST_CFLAGS) -DXSERVER_PATH='"@XSERVER_PATH@"'

IMO this is a superfluous, there are plenty of lines going over 80
chars and this doesn't really make it any more readable. either way:

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
   Peter

>  xwayland_test_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS)
>  endif
>  
> diff --git a/tests/xwayland-test.c b/tests/xwayland-test.c
> index af306c1..d9d4a2d 100644
> --- a/tests/xwayland-test.c
> +++ b/tests/xwayland-test.c
> @@ -53,6 +53,9 @@ TEST(xwayland_client_test)
>  	Atom atom, type_atom, actual_type;
>  	char *wm_name;
>  
> +	if (access(XSERVER_PATH, X_OK) != 0)
> +		exit(77);
> +
>  	display = XOpenDisplay(NULL);
>  	if (!display)
>  		exit(EXIT_FAILURE);
> -- 
#> 2.9.3
#> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 


More information about the wayland-devel mailing list