Makefile.am 4.38 KB
Newer Older
1
if ENABLE_UNIT_TESTS
2
SUBDIRS= .
3 4 5
AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
AM_CPPFLAGS = $(XORG_INCS)

6 7 8
tests_CPPFLAGS=
CLEANFILES=

9 10
tests_SOURCES = \
        tests-common.c \
11
	tests-common.h \
12 13
        list.c \
        string.c \
14 15
        tests.c \
	tests.h
16

17
noinst_PROGRAMS = simple-xinit tests
18

19 20
if XVFB
XVFB_TESTS = scripts/xvfb-piglit.sh
21 22 23 24 25
if XEPHYR
if GLAMOR
XEPHYR_GLAMOR_TESTS = scripts/xephyr-glamor-piglit.sh
endif
endif
26 27 28 29
endif

SCRIPT_TESTS = \
	$(XVFB_TESTS) \
30
	$(XEPHYR_GLAMOR_TESTS) \
31 32
	$(NULL)

33
TESTS = tests \
34 35 36 37
	$(SCRIPT_TESTS) \
	$(NULL)

TESTS_ENVIRONMENT = \
38 39
	XSERVER_DIR=$(abs_top_srcdir) \
	XSERVER_BUILDDIR=$(abs_top_builddir) \
40 41
	$(XORG_MALLOC_DEBUG_ENV) \
	$(NULL)
42

43 44
tests_LDADD =

45
if XORG
46 47 48 49

# Tests that require at least some DDX functions in order to fully link
# For now, requires xf86 ddx, could be adjusted to use another

50 51 52 53 54
AM_CPPFLAGS += \
	-I$(srcdir)/xi1 \
	-I$(srcdir)/xi2 \
	-I$(top_srcdir)/hw/xfree86/common \
	-I$(top_srcdir)/hw/xfree86/parser \
55
	-I$(top_srcdir)/hw/xfree86/ddc \
56
	-I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \
57
	-I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \
Keith Packard's avatar
Keith Packard committed
58
	-I$(top_srcdir)/hw/xfree86/dri2 -I$(top_srcdir)/dri3
59
tests_CPPFLAGS += $(AM_CPPFLAGS)
60

61
tests_SOURCES += \
62 63 64 65 66 67 68
        fixes.c \
        input.c \
        misc.c \
        signal-logging.c \
        touch.c \
        xfree86.c \
        test_xkb.c \
69 70 71 72 73 74 75 76 77
        xtest.c
tests_CPPFLAGS += -DXORG_TESTS

if RES
tests_SOURCES += hashtabletest.c
tests_CPPFLAGS += -DRES_TESTS
endif

endif XORG
78 79 80

if HAVE_LD_WRAP

81
tests_CPPFLAGS += -DLDWRAP_TESTS
82

83
if XORG
84 85 86 87 88 89 90 91 92 93 94 95 96
tests_SOURCES += \
	xi1/protocol-xchangedevicecontrol.c \
	xi2/protocol-common.c \
	xi2/protocol-xiqueryversion.c \
	xi2/protocol-xiquerydevice.c \
	xi2/protocol-xiselectevents.c \
	xi2/protocol-xigetselectedevents.c \
	xi2/protocol-xisetclientpointer.c \
	xi2/protocol-xigetclientpointer.c \
	xi2/protocol-xiquerypointer.c \
	xi2/protocol-xipassivegrabdevice.c \
	xi2/protocol-xiwarppointer.c \
	xi2/protocol-eventconvert.c \
97 98
	xi2/xi2.c \
	xi2/protocol-common.h
99

100 101 102 103 104 105 106 107 108 109 110
tests_LDFLAGS = \
	-Wl,-wrap,dixLookupWindow \
	-Wl,-wrap,dixLookupClient \
	-Wl,-wrap,WriteToClient \
	-Wl,-wrap,dixLookupWindow \
	-Wl,-wrap,XISetEventMask \
	-Wl,-wrap,AddResource \
	-Wl,-wrap,GrabButton \
	$()
endif XORG

111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
else !HAVE_LD_WRAP

# Print that xi1-tests were skipped (exit code 77 for automake test harness)
TESTS += xi1-tests
CLEANFILES += xi1-tests

xi1-tests:
	@echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@
	@echo 'exit 77' >> $@
	$(AM_V_GEN)chmod +x $@

# Print that xi2-tests were skipped (exit code 77 for automake test harness)
TESTS += xi2-tests
CLEANFILES += xi2-tests

xi2-tests:
	@echo 'echo "ld -wrap support required for xi2 unit tests, skipping"' > $@
	@echo 'exit 77' >> $@
	$(AM_V_GEN)chmod +x $@

endif !HAVE_LD_WRAP

133
if XORG
134

135 136 137
nodist_tests_SOURCES = sdksyms.c

tests_LDADD += \
138 139
            $(top_builddir)/hw/xfree86/loader/libloader.la \
            $(top_builddir)/hw/xfree86/common/libcommon.la \
140
            $(top_builddir)/hw/xfree86/os-support/libxorgos.la \
141
            $(top_builddir)/hw/xfree86/parser/libxf86config.la \
142 143 144 145 146
            $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \
            $(top_builddir)/hw/xfree86/modes/libxf86modes.la \
            $(top_builddir)/hw/xfree86/ramdac/libramdac.la \
            $(top_builddir)/hw/xfree86/ddc/libddc.la \
            $(top_builddir)/hw/xfree86/i2c/libi2c.la \
147
            $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \
148
            $(top_builddir)/Xext/libXvidmode.la \
149 150
            $(XSERVER_LIBS) \
            $(XORG_LIBS)
151

152 153 154 155
if !SPECIAL_DTRACE_OBJECTS
tests_LDADD += $(top_builddir)/os/libos.la
endif

156 157 158 159
if GLX
tests_LDADD += $(top_builddir)/glx/libglxvnd.la
endif

160
BUILT_SOURCES = sdksyms.c
161
CLEANFILES += sdksyms.c
162 163 164 165

sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c
	$(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.c

166
if DRI
167
tests_LDADD += $(top_builddir)/hw/xfree86/dri/libdri.la
168 169
endif

170
if DRI2
171
tests_LDADD += $(top_builddir)/hw/xfree86/dri2/libdri2.la
172 173
endif

174 175 176 177
if DRI3
tests_LDADD += $(top_builddir)/dri3/libdri3.la
endif

178
endif XORG
179

180 181 182 183
# GNU LD scans only in one direction, add the following dependencies at the end
# so as they get picked up by the previously-linked libraries
tests_LDADD += $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)

184
endif ENABLE_UNIT_TESTS
185

186
EXTRA_DIST = \
187 188
	scripts/xvfb-piglit.sh \
	scripts/xephyr-glamor-piglit.sh \
189
	scripts/xinit-piglit-session.sh \
190
	scripts/run-piglit.sh \
191
	$(NULL)
192