summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMihail Konev <k.mvc@ya.ru>2017-01-12 13:21:11 +0500
committerAdam Jackson <ajax@redhat.com>2017-01-12 15:01:38 -0500
commit23f6dbc96e47be6cbeed78cc9ef303987c3e29a9 (patch)
tree91a4c82b5ecce3e5d5e1880ad93cd1f1f6dfe838 /test
parentead5064581665ff40c177dd1b447949f1420e209 (diff)
tests: Move test/{xi1,xi2}/tests to test/
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Mihail Konev <k.mvc@ya.ru>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am65
-rw-r--r--test/tests.c16
-rw-r--r--test/xi1/.gitignore1
-rw-r--r--test/xi1/Makefile.am44
-rw-r--r--test/xi1/tests.c11
-rw-r--r--test/xi2/.gitignore1
-rw-r--r--test/xi2/Makefile.am56
-rw-r--r--test/xi2/tests.c21
8 files changed, 78 insertions, 137 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index d51d8624e..f91955bb8 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 cf72acafb..add51bd48 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 2b29f2764..000000000
--- 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 7a054dd80..000000000
--- 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 df4638dc9..000000000
--- 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 2b29f2764..000000000
--- 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 a7f9831a9..000000000
--- 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 559fb23ed..000000000
--- 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;
-}