Makefile.am (4531B)
1 if ENABLE_UNIT_TESTS 2 SUBDIRS= . 3 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ 4 AM_CPPFLAGS = $(XORG_INCS) 5 6 tests_CPPFLAGS= 7 CLEANFILES= 8 9 tests_SOURCES = \ 10 tests-common.c \ 11 tests-common.h \ 12 list.c \ 13 string.c \ 14 tests.c \ 15 tests.h 16 17 noinst_PROGRAMS = simple-xinit tests 18 19 if XVFB 20 XVFB_TESTS = scripts/xvfb-piglit.sh 21 if XEPHYR 22 if GLAMOR 23 XEPHYR_GLAMOR_TESTS = scripts/xephyr-glamor-piglit.sh 24 endif 25 endif 26 endif 27 28 SCRIPT_TESTS = \ 29 $(XVFB_TESTS) \ 30 $(XEPHYR_GLAMOR_TESTS) \ 31 $(NULL) 32 33 TESTS = tests \ 34 $(SCRIPT_TESTS) \ 35 $(NULL) 36 37 TESTS_ENVIRONMENT = \ 38 XSERVER_DIR=$(abs_top_srcdir) \ 39 XSERVER_BUILDDIR=$(abs_top_builddir) \ 40 $(XORG_MALLOC_DEBUG_ENV) \ 41 $(NULL) 42 43 tests_LDADD = 44 45 if XORG 46 47 # Tests that require at least some DDX functions in order to fully link 48 # For now, requires xf86 ddx, could be adjusted to use another 49 50 AM_CPPFLAGS += \ 51 -I$(srcdir)/xi1 \ 52 -I$(srcdir)/xi2 \ 53 -I$(top_srcdir)/hw/xfree86/common \ 54 -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 \ 58 -I$(top_srcdir)/hw/xfree86/dri2 -I$(top_srcdir)/dri3 59 tests_CPPFLAGS += $(AM_CPPFLAGS) 60 61 tests_SOURCES += \ 62 fixes.c \ 63 input.c \ 64 misc.c \ 65 signal-logging.c \ 66 touch.c \ 67 xfree86.c \ 68 test_xkb.c \ 69 xtest.c 70 tests_CPPFLAGS += -DXORG_TESTS 71 72 if RES 73 tests_SOURCES += hashtabletest.c 74 tests_CPPFLAGS += -DRES_TESTS 75 endif 76 77 endif XORG 78 79 if HAVE_LD_WRAP 80 81 tests_CPPFLAGS += -DLDWRAP_TESTS 82 83 if XORG 84 tests_SOURCES += \ 85 xi1/protocol-xchangedevicecontrol.c \ 86 xi2/protocol-common.c \ 87 xi2/protocol-xiqueryversion.c \ 88 xi2/protocol-xiquerydevice.c \ 89 xi2/protocol-xiselectevents.c \ 90 xi2/protocol-xigetselectedevents.c \ 91 xi2/protocol-xisetclientpointer.c \ 92 xi2/protocol-xigetclientpointer.c \ 93 xi2/protocol-xiquerypointer.c \ 94 xi2/protocol-xipassivegrabdevice.c \ 95 xi2/protocol-xiwarppointer.c \ 96 xi2/protocol-eventconvert.c \ 97 xi2/xi2.c \ 98 xi2/protocol-common.h 99 100 tests_LDFLAGS = \ 101 -Wl,-wrap,dixLookupWindow \ 102 -Wl,-wrap,dixLookupClient \ 103 -Wl,-wrap,WriteToClient \ 104 -Wl,-wrap,dixLookupWindow \ 105 -Wl,-wrap,XISetEventMask \ 106 -Wl,-wrap,AddResource \ 107 -Wl,-wrap,GrabButton \ 108 $() 109 endif XORG 110 111 else !HAVE_LD_WRAP 112 113 # Print that xi1-tests were skipped (exit code 77 for automake test harness) 114 TESTS += xi1-tests 115 CLEANFILES += xi1-tests 116 117 xi1-tests: 118 @echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@ 119 @echo 'exit 77' >> $@ 120 $(AM_V_GEN)chmod +x $@ 121 122 # Print that xi2-tests were skipped (exit code 77 for automake test harness) 123 TESTS += xi2-tests 124 CLEANFILES += xi2-tests 125 126 xi2-tests: 127 @echo 'echo "ld -wrap support required for xi2 unit tests, skipping"' > $@ 128 @echo 'exit 77' >> $@ 129 $(AM_V_GEN)chmod +x $@ 130 131 endif !HAVE_LD_WRAP 132 133 if XORG 134 135 nodist_tests_SOURCES = sdksyms.c 136 137 tests_LDADD += \ 138 $(top_builddir)/hw/xfree86/loader/libloader.la \ 139 $(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 $(top_builddir)/hw/xfree86/dixmods/libdixmods.la \ 143 $(top_builddir)/hw/xfree86/modes/libxf86modes.la \ 144 $(top_builddir)/hw/xfree86/ramdac/libramdac.la \ 145 $(top_builddir)/hw/xfree86/ddc/libddc.la \ 146 $(top_builddir)/hw/xfree86/i2c/libi2c.la \ 147 $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \ 148 $(top_builddir)/Xext/libXvidmode.la \ 149 $(top_builddir)/fb/libfb.la \ 150 $(XSERVER_LIBS) \ 151 $(XORG_LIBS) 152 153 if !SPECIAL_DTRACE_OBJECTS 154 tests_LDADD += $(top_builddir)/os/libos.la 155 endif 156 157 if GLX 158 tests_LDADD += $(top_builddir)/glx/libglxvnd.la 159 endif 160 161 BUILT_SOURCES = sdksyms.c 162 CLEANFILES += sdksyms.c 163 164 sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c 165 $(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.c 166 167 if DRI 168 tests_LDADD += $(top_builddir)/hw/xfree86/dri/libdri.la 169 endif 170 171 if DRI2 172 tests_LDADD += $(top_builddir)/hw/xfree86/dri2/libdri2.la 173 endif 174 175 if DRI3 176 tests_LDADD += $(top_builddir)/dri3/libdri3.la 177 endif 178 179 endif XORG 180 181 # GNU LD scans only in one direction, add the following dependencies at the end 182 # so as they get picked up by the previously-linked libraries 183 tests_LDADD += $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) 184 185 endif ENABLE_UNIT_TESTS 186 187 EXTRA_DIST = \ 188 scripts/xvfb-piglit.sh \ 189 scripts/xephyr-glamor-piglit.sh \ 190 scripts/xinit-piglit-session.sh \ 191 scripts/run-piglit.sh \ 192 $(NULL) 193