[PATCH v5 xserver 7/6] tests: fix --disable-xorg build

Mihail Konev k.mvc at ya.ru
Sat Jan 14 10:19:30 UTC 2017


Commit ead5064581665ff40c177dd1b447949f1420e209 missed that xi1/
and xi2/ were conditioned on XORG, and made xfree86-only tests to be
built unconditionally.
Ifdef the tests and split tests_SOURCES.

Commit 704a867f8fb7652a8b7d5569bbe44e188457db4e missed that when
XORG is false, libxservertest.la isn't linked into anything.
However, before putting them into tests_LDADD, its static libraries
likely need to be reordered for linking not to fail.
Remove the former libxservertest.la for !XORG, as its build was only
triggered by 'make check'.
XSERVER_LIBS were depending on it; remove them too.

Commit 23f6dbc96e47be6cbeed78cc9ef303987c3e29a9 missed that -wrap
arguments to 'ld' could only be present when HAVE_LD_WRAP is true.

Signed-off-by: Mihail Konev <k.mvc at ya.ru>
---
 test/Makefile.am | 107 ++++++++++++++-----------------------------------------
 test/tests.c     |   9 ++---
 2 files changed, 31 insertions(+), 85 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 729402f104ce..33ac65c37084 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,6 +7,7 @@ tests_CPPFLAGS=
 CLEANFILES=
 
 if XORG
+AM_CPPFLAGS += -DXORG_TESTS
 # Tests that require at least some DDX functions in order to fully link
 # For now, requires xf86 ddx, could be adjusted to use another
 if RES
@@ -54,6 +55,16 @@ AM_CPPFLAGS += \
 tests_CPPFLAGS += $(AM_CPPFLAGS)
 endif
 
+tests_LDADD = $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
+
+tests_SOURCES = \
+        tests-common.c \
+        tests.c \
+        list.c \
+        string.c
+
+if HAVE_LD_WRAP
+
 tests_LDFLAGS = \
 	-Wl,-wrap,dixLookupWindow \
 	-Wl,-wrap,dixLookupClient \
@@ -64,27 +75,8 @@ tests_LDFLAGS = \
 	-Wl,-wrap,GrabButton \
 	$()
 
-tests_LDADD = $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
-
-tests_SOURCES = \
-        tests-common.c \
-        fixes.c \
-        input.c \
-        list.c \
-        misc.c \
-        signal-logging.c \
-        string.c \
-        touch.c \
-        xfree86.c \
-        test_xkb.c \
-        xtest.c \
-        $(RES_SRCS) \
-        tests.c
-
-if HAVE_LD_WRAP
-
+if XORG
 tests_CPPFLAGS += -DLDWRAP_TESTS
-
 tests_SOURCES += \
 	xi1/protocol-xchangedevicecontrol.c \
 	xi2/protocol-common.c \
@@ -99,6 +91,7 @@ tests_SOURCES += \
 	xi2/protocol-xiwarppointer.c \
 	xi2/protocol-eventconvert.c \
 	xi2/xi2.c
+endif
 
 else !HAVE_LD_WRAP
 
@@ -122,9 +115,20 @@ xi2-tests:
 
 endif !HAVE_LD_WRAP
 
+if XORG
+
 tests_LDADD += $(XSERVER_LIBS)
 
-if XORG
+tests_SOURCES += \
+        $(RES_SRCS) \
+        fixes.c \
+        input.c \
+        misc.c \
+        signal-logging.c \
+        touch.c \
+        xfree86.c \
+        test_xkb.c \
+        xtest.c
 
 nodist_tests_SOURCES = sdksyms.c
 
@@ -160,66 +164,7 @@ if DRI3
 tests_LDADD += $(top_builddir)/dri3/libdri3.la
 endif
 
-else !XORG
-
-nodist_tests_SOURCES = \
-            ddxstubs.c \
-            $(top_srcdir)/mi/miinitext.c
-
-tests_LDADD += \
-            $(top_builddir)/damageext/libdamageext.la \
-            $(top_builddir)/fb/libfb.la \
-            $(top_builddir)/fb/libwfb.la \
-            $(top_builddir)/miext/damage/libdamage.la \
-            $(top_builddir)/miext/sync/libsync.la \
-            $(top_builddir)/randr/librandr.la \
-            $(top_builddir)/render/librender.la \
-            $(top_builddir)/Xext/libXext.la \
-            $(top_builddir)/Xext/libXextdpmsstubs.la \
-            $(top_builddir)/Xext/libXvidmode.la \
-            $(top_builddir)/Xi/libXi.la \
-            $(top_builddir)/Xi/libXistubs.la \
-            $(top_builddir)/xfixes/libxfixes.la \
-            $(top_builddir)/xkb/libxkb.la \
-            $(top_builddir)/xkb/libxkbstubs.la
-
-if COMPOSITE
-tests_LDADD += \
-            $(top_builddir)/composite/libcomposite.la
-endif
-
-if DBE
-tests_LDADD += \
-            $(top_builddir)/dbe/libdbe.la
-endif
-
-if GLX
-tests_LDADD += \
-            $(top_builddir)/glx/libglx.la
-endif
-
-if RECORD
-tests_LDADD += \
-            $(top_builddir)/record/librecord.la
-endif
-
-if DRI3
-tests_LDADD += \
-            $(top_builddir)/dri3/libdri3.la
-endif
-
-if XQUARTZ
-tests_LDADD += \
-            $(top_builddir)/miext/rootless/librootless.la
-tests_LDADD += -lXplugin
-endif
-
-if XWIN_MULTIWINDOWEXTWM
-tests_LDADD += \
-            $(top_builddir)/miext/rootless/librootless.la
-endif
-
-endif !XORG
+endif XORG
 
 tests_DEPENDENCIES = $(tests_LDADD)
 endif ENABLE_UNIT_TESTS
diff --git a/test/tests.c b/test/tests.c
index add51bd4834d..45b390af29fc 100644
--- a/test/tests.c
+++ b/test/tests.c
@@ -5,21 +5,22 @@
 int
 main(int argc, char **argv)
 {
-    run_test(fixes_test);
+    run_test(list_test);
+    run_test(string_test);
 
+#if XORG_TESTS
+    run_test(fixes_test);
 #ifdef RES_TESTS
     run_test(hashtabletest_test);
 #endif
-
     run_test(input_test);
-    run_test(list_test);
     run_test(misc_test);
     run_test(signal_logging_test);
-    run_test(string_test);
     run_test(touch_test);
     run_test(xfree86_test);
     run_test(xkb_test);
     run_test(xtest_test);
+#endif
 
 #ifdef LDWRAP_TESTS
     run_test(protocol_xchangedevicecontrol_test);
-- 
2.9.2



More information about the xorg-devel mailing list