[v7,xserver] tests: fixes for non-enable-xorg build

Submitted by Mihail Konev on Jan. 31, 2017, 3:16 p.m.

Details

Message ID 20170131151635.GA12609@localhost
State Accepted, archived
Headers show
Series "tests: Build test programs only when testing" ( rev: 23 ) in X.org (DEPRECATED - USE GITLAB)

Not browsing as part of any series.

Commit Message

Mihail Konev Jan. 31, 2017, 3:16 p.m.
v7: add regressed-by lines

Patch hide | download patch | download mbox

From c55acff0f1c9bd67ec67119979589b4982a934d3 Mon Sep 17 00:00:00 2001
From: Mihail Konev <k.mvc@ya.ru>
Date: Mon, 16 Jan 2017 23:55:36 +0500
Subject: [PATCH v7 xserver 1/3] tests: Fix guards for ld -wrap

Fixes XQuartz build.

Regressed-in: 23f6dbc96e47be6cbeed78cc9ef303987c3e29a9
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
---
 test/Makefile.am | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index e7fe587bb858..1c1f1da0e31f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -54,16 +54,6 @@  AM_CPPFLAGS += \
 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 =
 
 tests_SOURCES = \
@@ -100,6 +90,16 @@  tests_SOURCES += \
 	xi2/protocol-eventconvert.c \
 	xi2/xi2.c
 
+tests_LDFLAGS = \
+	-Wl,-wrap,dixLookupWindow \
+	-Wl,-wrap,dixLookupClient \
+	-Wl,-wrap,WriteToClient \
+	-Wl,-wrap,dixLookupWindow \
+	-Wl,-wrap,XISetEventMask \
+	-Wl,-wrap,AddResource \
+	-Wl,-wrap,GrabButton \
+	$()
+
 else !HAVE_LD_WRAP
 
 # Print that xi1-tests were skipped (exit code 77 for automake test harness)
-- 
2.9.2


From f016925934b8bc71d6908b0e18d99b320b10ab2a Mon Sep 17 00:00:00 2001
From: Mihail Konev <k.mvc@ya.ru>
Date: Tue, 17 Jan 2017 00:11:03 +0500
Subject: [PATCH v7 xserver 2/3] tests: Fix guards for xfree86 tests

Fixes xfree86 includes being pulled in by tests with --disable-xorg
or --enable-xwin.

Regressed-in: ead5064581665ff40c177dd1b447949f1420e209
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
---
 test/Makefile.am | 41 +++++++++++++++++++++++------------------
 test/tests.c     | 17 ++++++++++-------
 2 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 1c1f1da0e31f..e72bfe19bede 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -6,14 +6,11 @@  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
-if RES
-RES_SRCS = hashtabletest.c
-AM_CPPFLAGS += -DRES_TESTS
-endif
-endif
+tests_SOURCES = \
+        tests-common.c \
+        list.c \
+        string.c \
+        tests.c
 
 noinst_PROGRAMS = simple-xinit tests
 
@@ -41,7 +38,13 @@  TESTS_ENVIRONMENT = \
 	$(XORG_MALLOC_DEBUG_ENV) \
 	$(NULL)
 
+tests_LDADD =
+
 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
+
 AM_CPPFLAGS += \
 	-I$(srcdir)/xi1 \
 	-I$(srcdir)/xi2 \
@@ -52,29 +55,30 @@  AM_CPPFLAGS += \
 	-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_LDADD =
 
-tests_SOURCES = \
-        tests-common.c \
+tests_SOURCES += \
         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
+        xtest.c
+tests_CPPFLAGS += -DXORG_TESTS
+
+if RES
+tests_SOURCES += hashtabletest.c
+tests_CPPFLAGS += -DRES_TESTS
+endif
+
+endif XORG
 
 if HAVE_LD_WRAP
 
 tests_CPPFLAGS += -DLDWRAP_TESTS
 
+if XORG
 tests_SOURCES += \
 	xi1/protocol-xchangedevicecontrol.c \
 	xi2/protocol-common.c \
@@ -99,6 +103,7 @@  tests_LDFLAGS = \
 	-Wl,-wrap,AddResource \
 	-Wl,-wrap,GrabButton \
 	$()
+endif XORG
 
 else !HAVE_LD_WRAP
 
diff --git a/test/tests.c b/test/tests.c
index add51bd4834d..97603822abaf 100644
--- a/test/tests.c
+++ b/test/tests.c
@@ -5,22 +5,23 @@ 
 int
 main(int argc, char **argv)
 {
-    run_test(fixes_test);
-
-#ifdef RES_TESTS
-    run_test(hashtabletest_test);
-#endif
+    run_test(list_test);
+    run_test(string_test);
 
+#ifdef XORG_TESTS
+    run_test(fixes_test);
     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);
 
+#ifdef RES_TESTS
+    run_test(hashtabletest_test);
+#endif
+
 #ifdef LDWRAP_TESTS
     run_test(protocol_xchangedevicecontrol_test);
 
@@ -37,5 +38,7 @@  main(int argc, char **argv)
     run_test(xi2_test);
 #endif
 
+#endif /* XORG_TESTS */
+
     return 0;
 }
-- 
2.9.2


From 90cbde44c121c762cc8c77cb7bb78228c52f9bab Mon Sep 17 00:00:00 2001
From: Mihail Konev <k.mvc@ya.ru>
Date: Tue, 17 Jan 2017 00:36:49 +0500
Subject: [PATCH v7 xserver 3/3] tests: Link additional libs only for xfree86

The libxservertest.la encapsulated libraries that could have been
needed by tests.

However, it was only needed for tests specific to xfree86 DDX.
For others, the components differed, but were not required.

Now when there is no libxservertest.a library anymore, the order
of components matters, causing linking errors in the second case.

Remove the components, together with the XSERVER_LIBS prerequisite.

Regressed-in: 704a867f8fb7652a8b7d5569bbe44e188457db4e
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
---
 test/Makefile.am | 66 +++-----------------------------------------------------
 1 file changed, 3 insertions(+), 63 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index e72bfe19bede..cb37cc9fec96 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -127,8 +127,6 @@  xi2-tests:
 
 endif !HAVE_LD_WRAP
 
-tests_LDADD += $(XSERVER_LIBS)
-
 if XORG
 
 nodist_tests_SOURCES = sdksyms.c
@@ -145,7 +143,8 @@  tests_LDADD += \
             $(top_builddir)/hw/xfree86/i2c/libi2c.la \
             $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
             $(top_builddir)/Xext/libXvidmode.la \
-            @XORG_LIBS@
+            $(XSERVER_LIBS) \
+            $(XORG_LIBS)
 
 if !SPECIAL_DTRACE_OBJECTS
 tests_LDADD += $(top_builddir)/os/libos.la
@@ -169,66 +168,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
 
 # GNU LD scans only in one direction, add the following dependencies at the end
 # so as they get picked up by the previously-linked libraries
-- 
2.9.2


Comments

On Tue, 31 Jan 2017 20:16:35 +0500
Mihail Konev <k.mvc@ya.ru> wrote:

> v7: add regressed-by lines

Hi,

current xserver master branch fails for me using:

./configure --disable-docs --disable-devel-docs --enable-xwayland
--disable-{xorg,xvfb,xnest,xquartz,xwin} --enable-debug

xfree86.c:30:18: fatal error: xf86.h: No such file or directory
xi1/protocol-xchangedevicecontrol.c:38:29: fatal error: protocol-common.h: No such file or directory

Bisected: ead5064581665ff40c177dd1b447949f1420e209 is the first bad commit:
	tests: Convert test/ to single binary


This "patch" fixes those failures for me, and 'make check' is happy.

Mihail, could you stick to the standard patch submission, please?
One patch, inline, per one email. No attachments, no weird
multi-patches. Use git-send-email if at all possible.

git-am did successfully consume this v7 email, but I am not sure what
it did. It only generated one commit, with a commit message of the
email body and the first patch only, but apparently squashed all the
patches. I suppose. That's what I tested, but as I'm not sure what it
was, I cannot give a Tested-by for now.

Also, have you kept Patchwork updated? There are quite a lot at:
https://patchwork.freedesktop.org/project/Xorg/patches/?submitter=16444
At least a few sound like they should be marked as superseded.

I'll leave it for the xserver maintainers to say if they want a
re-submission or not.


Thanks,
pq
On Fri, 2017-02-17 at 12:20 +0200, Pekka Paalanen wrote:

> This "patch" fixes those failures for me, and 'make check' is happy.

Merged:

remote: E: failed to find patch for rev fde5cd78488f3370c92397868ca78929296f7ad1.
remote: I: 0 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   d8161ae..fde5cd7  master -> master

- ajax