tests: Skip Xwayland test if binary isn't available
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@collabora.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
+2
-1
@@ -1354,7 +1354,8 @@ endif
|
|||||||
if ENABLE_XWAYLAND_TEST
|
if ENABLE_XWAYLAND_TEST
|
||||||
weston_tests += xwayland-test.weston
|
weston_tests += xwayland-test.weston
|
||||||
xwayland_test_weston_SOURCES = tests/xwayland-test.c
|
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@"'
|
||||||
xwayland_test_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS)
|
xwayland_test_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ TEST(xwayland_client_test)
|
|||||||
Atom atom, type_atom, actual_type;
|
Atom atom, type_atom, actual_type;
|
||||||
char *wm_name;
|
char *wm_name;
|
||||||
|
|
||||||
|
if (access(XSERVER_PATH, X_OK) != 0)
|
||||||
|
exit(77);
|
||||||
|
|
||||||
display = XOpenDisplay(NULL);
|
display = XOpenDisplay(NULL);
|
||||||
if (!display)
|
if (!display)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|||||||
Reference in New Issue
Block a user