test: Add a little xinit-like program for starting servers for testing

The normal xinit is racy because it doesn't use -displayfd.  This
implements the bare minimum for testing purposes, using -displayfd to
sequence starting the client, and avoids adding yet another dependency
to the server.

v2: Fix asprintf error checks.
v3: Add error checking for fork(), clarify calloc() arg.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Eric Anholt 2016-09-25 13:30:17 -07:00 • committed by Adam Jackson
commit 7ac130a066
3 changed files with 239 additions and 4 deletions

View file

@ -1,17 +1,22 @@
if ENABLE_UNIT_TESTS
SUBDIRS= .
noinst_PROGRAMS = list string
TEST_PROGS = list string
if XORG
# Tests that require at least some DDX functions in order to fully link
# For now, requires xf86 ddx, could be adjusted to use another
SUBDIRS += xi1 xi2
noinst_PROGRAMS += xkb input xtest misc fixes xfree86 signal-logging touch
TEST_PROGS += xkb input xtest misc fixes xfree86 signal-logging touch
if RES
noinst_PROGRAMS += hashtabletest
TEST_PROGS += hashtabletest
endif
endif
check_LTLIBRARIES = libxservertest.la
noinst_PROGRAMS = \
simple-xinit \
$(TEST_PROGS) \
$(NULL)
if XVFB
XVFB_TESTS = scripts/xvfb-piglit.sh
endif
@ -21,7 +26,7 @@ SCRIPT_TESTS = \
$(NULL)
TESTS = \
$(noinst_PROGRAMS) \
$(TEST_PROGS) \
$(SCRIPT_TESTS) \
$(NULL)