summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2011-03-17 19:26:36 -0400
committerKeith Packard <keithp@keithp.com>2011-03-18 11:36:19 -0700
commit6a5bf15fa99cf5b2358b3b3e2f29e5044aa8724a (patch)
tree2a2f5e1c54920863d279edf5a9295b1f0eebed63 /test
parentee583cb33423fa79beb22db20b30e10a677f9b5a (diff)
Add generalized unit test support using util-macros.
A handful of modules have begun adding unit test programs. These macros will help providing a consistent interface which will help package builders and developers to manage the functionality. XORG_ENABLE_UNIT_TESTS will turn on/off unit testing, regardless of how it is implemented. The default (yes/no) can be specified by each module. It can be used by itself if glib or -wrap support is not needed. XORG_WITH_GLIB will probe the system for glib-2.0. A different version can be specified in each module. It will consult XORG_ENABLE_UNIT_TESTS but can be used by itself in contexts other then unit testing. The default (yes/no) can be specified by each module. XORG_LD_WRAP will probe the linker for -wrap support. It will consult XORG_ENABLE_UNIT_TESTS but can be used by itself in contexts other then unit testing. configure options: --enable-unit-tests Enable building unit test cases (default: auto) --with-glib Use GLib library for unit testing (default: auto) Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am6
-rw-r--r--test/xi2/Makefile.am6
2 files changed, 10 insertions, 2 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index be54e5f24..34f21d7ed 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,6 @@
-if UNITTESTS
+if ENABLE_UNIT_TESTS
+if HAVE_GLIB
+if HAVE_LD_WRAP
SUBDIRS= . xi2
check_PROGRAMS = xkb input xtest list
check_LTLIBRARIES = libxservertest.la
@@ -35,6 +37,8 @@ libxservertest_la_LIBADD = \
$(top_builddir)/os/libos.la \
@XORG_LIBS@
endif
+endif
+endif
CLEANFILES=libxservertest.c
diff --git a/test/xi2/Makefile.am b/test/xi2/Makefile.am
index d8dc7e9ce..e19786973 100644
--- a/test/xi2/Makefile.am
+++ b/test/xi2/Makefile.am
@@ -1,4 +1,6 @@
-if UNITTESTS
+if ENABLE_UNIT_TESTS
+if HAVE_GLIB
+if HAVE_LD_WRAP
check_PROGRAMS = \
protocol-xiqueryversion \
protocol-xiquerydevice \
@@ -49,3 +51,5 @@ protocol_xigetclientpointer_SOURCES=$(COMMON_SOURCES) protocol-xigetclientpointe
protocol_xiquerypointer_SOURCES=$(COMMON_SOURCES) protocol-xiquerypointer.c
protocol_xiwarppointer_SOURCES=$(COMMON_SOURCES) protocol-xiwarppointer.c
endif
+endif
+endif