[PATCH:xserver 2/5] Don't require ld -wrap for tests that don't need it

Alan Coopersmith alan.coopersmith at oracle.com
Thu Nov 3 19:56:28 PDT 2011


If configure is generated with xorg-macros 1.16 or later, this allows
builders to --enable-unit-test and run the tests other than the xi2
tests which require ld -wrap (and are still wrapped in if HAVE_LD_WRAP
in tests/xi2/Makefile).  If an older xorg-macros is used, the existing
behaviour is preserved of requiring ld -wrap for all unit tests, but
no side effects occur, so the minimum xorg-macros version is not raised.

If unit testing is enabled without ld -wrap, then we create a bogus
"xi2-tests" script just to report that we're skipping them.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac         |    2 +-
 test/Makefile.am     |    2 --
 test/xi2/Makefile.am |    9 +++++++++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index a000c82..abc6267 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,7 @@ XORG_WITH_XMLTO(0.0.20)
 XORG_WITH_FOP
 XORG_WITH_XSLTPROC
 XORG_ENABLE_UNIT_TESTS
-XORG_LD_WRAP
+XORG_LD_WRAP([optional])
 
 m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])])
 XORG_FONT_MACROS_VERSION(1.1)
diff --git a/test/Makefile.am b/test/Makefile.am
index 87768a7..3bf1f1b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,5 +1,4 @@
 if ENABLE_UNIT_TESTS
-if HAVE_LD_WRAP
 SUBDIRS= . xi2
 noinst_PROGRAMS = xkb input xtest list misc fixes xfree86 string
 check_LTLIBRARIES = libxservertest.la
@@ -43,4 +42,3 @@ libxservertest_la_LIBADD = \
             @XORG_LIBS@
 libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD)
 endif
-endif
diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am
index b15d8ba..d72bcda 100644
--- a/test/xi2/Makefile.am
+++ b/test/xi2/Makefile.am
@@ -53,5 +53,14 @@ protocol_xigetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xigetclientpointe
 protocol_xiquerypointer_SOURCES=$(COMMON_SOURCES) protocol-xiquerypointer.c
 protocol_xipassivegrabdevice_SOURCES=$(COMMON_SOURCES) protocol-xipassivegrabdevice.c
 protocol_xiwarppointer_SOURCES=$(COMMON_SOURCES) protocol-xiwarppointer.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
-- 
1.7.3.2



More information about the xorg-devel mailing list