diff --git a/configure.ac b/configure.ac index 93c81a644052eb4627041e82fdcddd3c05dd372a..d265528ea1242de0ee0ed365625bda8e0ca8aaac 100644 --- a/configure.ac +++ b/configure.ac @@ -2679,8 +2679,6 @@ hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile -test/xi1/Makefile -test/xi2/Makefile xserver.ent xorg-server.pc ]) diff --git a/test/Makefile.am b/test/Makefile.am index d51d8624e4de9e75bfae7c2ffd1a318b22aee7f3..f91955bb8593a44df3d639779d9ed71d4d3afe51 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,10 +3,12 @@ SUBDIRS= . AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ AM_CPPFLAGS = $(XORG_INCS) +tests_CPPFLAGS= +CLEANFILES= + 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 if RES RES_SRCS = hashtabletest.c AM_CPPFLAGS += -DRES_TESTS @@ -41,12 +43,28 @@ TESTS_ENVIRONMENT = \ $(NULL) if XORG -AM_CPPFLAGS += -I$(top_srcdir)/hw/xfree86/parser \ +AM_CPPFLAGS += \ + -I$(srcdir)/xi1 \ + -I$(srcdir)/xi2 \ + -I$(top_srcdir)/hw/xfree86/common \ + -I$(top_srcdir)/hw/xfree86/parser \ -I$(top_srcdir)/hw/xfree86/ddc \ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \ -I$(top_srcdir)/hw/xfree86/dri2 -I$(top_srcdir)/dri3 +tests_CPPFLAGS += $(AM_CPPFLAGS) endif + +tests_LDFLAGS = \ + -Wl,-wrap,dixLookupWindow \ + -Wl,-wrap,dixLookupClient \ + -Wl,-wrap,WriteToClient \ + -Wl,-wrap,dixLookupWindow \ + -Wl,-wrap,XISetEventMask \ + -Wl,-wrap,AddResource \ + -Wl,-wrap,GrabButton \ + $() + tests_LDADD = libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) if SPECIAL_DTRACE_OBJECTS @@ -68,6 +86,47 @@ tests_SOURCES = \ $(RES_SRCS) \ tests.c +if HAVE_LD_WRAP + +tests_CPPFLAGS += -DLDWRAP_TESTS + +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 \ + xi2/xi2.c + +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 + libxservertest_la_LIBADD = $(XSERVER_LIBS) if XORG @@ -87,7 +146,7 @@ libxservertest_la_LIBADD += \ @XORG_LIBS@ BUILT_SOURCES = sdksyms.c -CLEANFILES = sdksyms.c +CLEANFILES += sdksyms.c sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c $(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.c diff --git a/test/tests.c b/test/tests.c index cf72acafb65b8b1bfcb351041fc9a0f5302e71ff..add51bd4834dbe7000fa1766f940433857e56493 100644 --- a/test/tests.c +++ b/test/tests.c @@ -21,5 +21,21 @@ main(int argc, char **argv) run_test(xkb_test); run_test(xtest_test); +#ifdef LDWRAP_TESTS + run_test(protocol_xchangedevicecontrol_test); + + run_test(protocol_xiqueryversion_test); + run_test(protocol_xiquerydevice_test); + run_test(protocol_xiselectevents_test); + run_test(protocol_xigetselectedevents_test); + run_test(protocol_xisetclientpointer_test); + run_test(protocol_xigetclientpointer_test); + run_test(protocol_xipassivegrabdevice_test); + run_test(protocol_xiquerypointer_test); + run_test(protocol_xiwarppointer_test); + run_test(protocol_eventconvert_test); + run_test(xi2_test); +#endif + return 0; } diff --git a/test/xi1/.gitignore b/test/xi1/.gitignore deleted file mode 100644 index 2b29f27645f8758ab5180164612d9f28154dee3a..0000000000000000000000000000000000000000 --- a/test/xi1/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tests diff --git a/test/xi1/Makefile.am b/test/xi1/Makefile.am deleted file mode 100644 index 7a054dd80966ade9b1e2f9d8fd4a593a1af645ac..0000000000000000000000000000000000000000 --- a/test/xi1/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -if ENABLE_UNIT_TESTS -if HAVE_LD_WRAP -noinst_PROGRAMS = tests - -TESTS = tests - -TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) - -tests_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ -tests_CPPFLAGS = \ - @XORG_INCS@ \ - -I$(srcdir)/.. \ - -I$(srcdir)/../xi2 \ - $() - -tests_LDFLAGS = \ - -Wl,-wrap,dixLookupWindow \ - -Wl,-wrap,dixLookupClient \ - -Wl,-wrap,WriteToClient \ - $() - -tests_LDADD =../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) - -tests_SOURCES = \ - $(srcdir)/../tests-common.c \ - $(srcdir)/../xi2/protocol-common.c \ - protocol-xchangedevicecontrol.c \ - tests.c - -if SPECIAL_DTRACE_OBJECTS -tests_LDADD += $(OS_LIB) $(DIX_LIB) -endif - -else -# Print that xi1-tests were skipped (exit code 77 for automake test harness) -TESTS = xi1-tests -CLEANFILES = $(TESTS) - -xi1-tests: - @echo 'echo "ld -wrap support required for xi1 unit tests, skipping"' > $@ - @echo 'exit 77' >> $@ - $(AM_V_GEN)chmod +x $@ -endif -endif diff --git a/test/xi1/tests.c b/test/xi1/tests.c deleted file mode 100644 index df4638dc98ab2286c3d40d6c7681fdc1cf1887d5..0000000000000000000000000000000000000000 --- a/test/xi1/tests.c +++ /dev/null @@ -1,11 +0,0 @@ -#include <string.h> -#include "tests.h" -#include "tests-common.h" - -int -main(int argc, char **argv) -{ - run_test(protocol_xchangedevicecontrol_test); - - return 0; -} diff --git a/test/xi2/.gitignore b/test/xi2/.gitignore deleted file mode 100644 index 2b29f27645f8758ab5180164612d9f28154dee3a..0000000000000000000000000000000000000000 --- a/test/xi2/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tests diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am deleted file mode 100644 index a7f9831a93cd7beb98ab40eace4e21ca72bf60f7..0000000000000000000000000000000000000000 --- a/test/xi2/Makefile.am +++ /dev/null @@ -1,56 +0,0 @@ -if ENABLE_UNIT_TESTS -if HAVE_LD_WRAP -noinst_PROGRAMS = tests - -TESTS = tests - -TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) - -tests_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ - -tests_CPPFLAGS = \ - @XORG_INCS@ \ - -I$(srcdir)/.. - -tests_LDADD = ../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) - -if SPECIAL_DTRACE_OBJECTS -tests_LDADD += $(OS_LIB) $(DIX_LIB) -endif - -tests_LDFLAGS = \ - -Wl,-wrap,WriteToClient \ - -Wl,-wrap,dixLookupWindow \ - -Wl,-wrap,XISetEventMask \ - -Wl,-wrap,AddResource \ - -Wl,-wrap,GrabButton \ - -Wl,-wrap,dixLookupClient \ - $() - -tests_SOURCES = \ - $(srcdir)/../tests-common.c \ - protocol-common.c \ - protocol-xiqueryversion.c \ - protocol-xiquerydevice.c \ - protocol-xiselectevents.c \ - protocol-xigetselectedevents.c \ - protocol-xisetclientpointer.c \ - protocol-xigetclientpointer.c \ - protocol-xiquerypointer.c \ - protocol-xipassivegrabdevice.c \ - protocol-xiwarppointer.c \ - protocol-eventconvert.c \ - xi2.c \ - tests.c - -else -# Print that xi2-tests were skipped (exit code 77 for automake test harness) -TESTS = xi2-tests -CLEANFILES = $(TESTS) - -xi2-tests: - @echo 'echo "ld -wrap support required for xi2 unit tests, skipping"' > $@ - @echo 'exit 77' >> $@ - $(AM_V_GEN)chmod +x $@ -endif -endif diff --git a/test/xi2/tests.c b/test/xi2/tests.c deleted file mode 100644 index 559fb23ed1d4be0ebc6c392cf93d026a894a6cbf..0000000000000000000000000000000000000000 --- a/test/xi2/tests.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "tests.h" -#include "tests-common.h" -#include "protocol-common.h" - -int -main(int argc, char **argv) -{ - run_test(protocol_xiqueryversion_test); - run_test(protocol_xiquerydevice_test); - run_test(protocol_xiselectevents_test); - run_test(protocol_xigetselectedevents_test); - run_test(protocol_xisetclientpointer_test); - run_test(protocol_xigetclientpointer_test); - run_test(protocol_xipassivegrabdevice_test); - run_test(protocol_xiquerypointer_test); - run_test(protocol_xiwarppointer_test); - run_test(protocol_eventconvert_test); - run_test(xi2_test); - - return 0; -}