[PATCH xserver 2/3] tests: fix guards for xfree86 tests

Mihail Konev k.mvc at ya.ru
Mon Jan 16 20:56:32 UTC 2017


Commit ead5064581665ff40c177dd1b447949f1420e209 missed that
xi1/ and xi2/ were conditioned on XORG, making them built
unconditionally.

Signed-off-by: Mihail Konev <k.mvc at ya.ru>
---
 test/Makefile.am | 40 ++++++++++++++++++++++------------------
 test/tests.c     | 17 ++++++++++-------
 2 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 8caec21b6415..d56c8fe50515 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
 
@@ -42,6 +39,7 @@ TESTS_ENVIRONMENT = \
 	$(NULL)
 
 if XORG
+
 AM_CPPFLAGS += \
 	-I$(srcdir)/xi1 \
 	-I$(srcdir)/xi2 \
@@ -52,29 +50,34 @@ 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 = $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
 
-tests_SOURCES = \
-        tests-common.c \
+# Tests that require at least some DDX functions in order to fully link
+# For now, requires xf86 ddx, could be adjusted to use another
+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
+
+tests_LDADD = $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
 
 if HAVE_LD_WRAP
 
 tests_CPPFLAGS += -DLDWRAP_TESTS
 
+if XORG
 tests_SOURCES += \
 	xi1/protocol-xchangedevicecontrol.c \
 	xi2/protocol-common.c \
@@ -99,6 +102,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



More information about the xorg-devel mailing list