0001-configure-add-option-to-disable-tests.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 33b025e04bf3fa94b74ea3325b3fd7c3f546bcb1 Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Sun, 5 Mar 2017 10:06:02 +0100
  4. Subject: [PATCH] configure: add option to disable tests
  5. When building for a product, tests are not needed.
  6. Besides, one test requires a C++ compiler, which is not always
  7. available.
  8. So, add an option to configure to disable building tests altogether.
  9. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  10. ---
  11. Patch submitted upstream:
  12. https://lists.freedesktop.org/archives/wayland-devel/2017-March/033359.html
  13. ---
  14. Makefile.am | 3 ++-
  15. configure.ac | 8 ++++++++
  16. 2 files changed, 10 insertions(+), 1 deletion(-)
  17. diff --git a/Makefile.am b/Makefile.am
  18. index d0c8bd3..9c2541d 100644
  19. --- a/Makefile.am
  20. +++ b/Makefile.am
  21. @@ -143,7 +143,7 @@ libwayland_cursor_la_CFLAGS = \
  22. -I$(top_srcdir)/src \
  23. -DICONDIR=\"$(ICONDIR)\"
  24. -
  25. +if ENABLE_TESTS
  26. built_test_programs = \
  27. array-test \
  28. client-test \
  29. @@ -258,6 +258,7 @@ os_wrappers_test_LDADD = libtest-runner.la
  30. exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
  31. exec_fd_leak_checker_LDADD = libtest-runner.la
  32. +endif
  33. EXTRA_DIST += tests/scanner-test.sh \
  34. tests/data/example.xml \
  35. diff --git a/configure.ac b/configure.ac
  36. index b583bef..96a5575 100644
  37. --- a/configure.ac
  38. +++ b/configure.ac
  39. @@ -87,10 +87,18 @@ AC_ARG_ENABLE([dtd-validation],
  40. [],
  41. [enable_dtd_validation=yes])
  42. +AC_ARG_ENABLE([tests],
  43. + [AC_HELP_STRING([--disable-tests],
  44. + [Disable compilation of test programs])],
  45. + [],
  46. + [enable_tests=yes])
  47. +
  48. AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
  49. AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
  50. +AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "yes")
  51. +
  52. AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
  53. [ ICONDIR=$withval],
  54. [ ICONDIR=${datadir}/icons])
  55. --
  56. 2.7.4