X server testing
Alan Coopersmith
Alan.Coopersmith at Sun.COM
Fri Jun 12 17:20:32 PDT 2009
Simon Thum wrote:
> this really looks good. I'll see if I can add a bit to it. There's one
> thing I think could be improved, maybe some autokung-foo master has a
> good idea how.
>
> For each test you need to declare overwritten methods like :
>
> protocol_xiselectevents_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,dixLookupWindow
> -Wl,-wrap,XISetEventMask
>
> It would be cooler if that was less verbose, like:
>
> protocol_xiselectevents_overrides=(dixLookupWindow, XISetEventMask)
>
> and CFLAGS would be made up by macro magic.
Since I had to modify this a bit anyway in my attempt to figure out if
there was any good way to make it work with Solaris ld, here's what I
have that seems to work, if you don't mind write-only makefile macros.
(The TEST_LINK macro magic would be less complex if we didn't have to
do the - to _ translation in the program name to get the wrapper
variable names.)
Of course, since I can't yet build the test programs, I can't claim it
really works, just seems to.
-Alan Coopersmith- alan.coopersmith at sun.com
Sun Microsystems, Inc. - X Window System Engineering
diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am
index c565442..d21997a 100644
--- a/test/xi2/Makefile.am
+++ b/test/xi2/Makefile.am
@@ -11,8 +11,9 @@ TESTS=$(check_PROGRAMS)
AM_CFLAGS = $(DIX_CFLAGS) $(GLIB_CFLAGS) @XORG_CFLAGS@
INCLUDES = @XORG_INCS@
-TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
-COMMON_SOURCES=protocol-common.h protocol-common.c
+TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
$(GLIB_LIBS) protocol-common.$(OBJEXT)
+COMMON_SRCS = protocol-common.h protocol-common.c
+EXTRA_DIST = $(COMMON_SRCS)
protocol_xiqueryversion_LDADD=$(TEST_LDADD)
protocol_xiquerydevice_LDADD=$(TEST_LDADD)
@@ -21,17 +22,20 @@ protocol_xigetselectedevents_LDADD=$(TEST_LDADD)
protocol_xisetclientpointer_LDADD=$(TEST_LDADD)
protocol_xigetclientpointer_LDADD=$(TEST_LDADD)
-protocol_xiqueryversion_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient
-protocol_xiquerydevice_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient
-protocol_xiselectevents_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,dixLookupWindow
-Wl,-wrap,XISetEventMask
-protocol_xigetselectedevents_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient
-Wl,-wrap,dixLookupWindow -Wl,-wrap,AddResource
-protocol_xisetclientpointer_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,dixLookupClient
-protocol_xigetclientpointer_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,WriteToClient
-Wl,-wrap,dixLookupClient
+protocol_xiqueryversion_wrappers= WriteToClient
+protocol_xiquerydevice_wrappers= WriteToClient
+protocol_xiselectevents_wrappers= dixLookupWindow XISetEventMask
+protocol_xigetselectedevents_wrappers= WriteToClient dixLookupWindow AddResource
+protocol_xisetclientpointer_wrappers= dixLookupClient
+protocol_xigetclientpointer_wrappers= WriteToClient dixLookupClient
+
+TEST_LINK = $(LINK) $($(@:protocol-%=protocol_%)_wrappers:%=-Wl,-wrap,%)
+
+protocol_xiqueryversion_LINK=$(TEST_LINK)
+protocol_xiquerydevice_LINK=$(TEST_LINK)
+protocol_xiselectevents_LINK=$(TEST_LINK)
+protocol_xigetselectedevents_LINK=$(TEST_LINK)
+protocol_xisetclientpointer_LINK=$(TEST_LINK)
+protocol_xigetclientpointer_LINK=$(TEST_LINK)
-protocol_xiqueryversion_SOURCES=$(COMMON_SOURCES) protocol-xiqueryversion.c
-protocol_xiquerydevice_SOURCES=$(COMMON_SOURCES) protocol-xiquerydevice.c
-protocol_xiselectevents_SOURCES=$(COMMON_SOURCES) protocol-xiselectevents.c
-protocol_xigetselectedevents_SOURCES=$(COMMON_SOURCES)
protocol-xigetselectedevents.c
-protocol_xisetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xisetclientpointer.c
-protocol_xigetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xigetclientpointer.c
endif
More information about the xorg-devel
mailing list