0001-build-add-option-to-disable-tests.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. From 283085496e06b5543771abe5cc746ff0b77cdd23 Mon Sep 17 00:00:00 2001
  2. From: James Hilliard <james.hilliard1@gmail.com>
  3. Date: Tue, 3 Mar 2020 15:27:51 -0700
  4. Subject: [PATCH] build: 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. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
  11. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
  12. [Upstream status:
  13. https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/66]
  14. ---
  15. Makefile.am | 2 ++
  16. configure.ac | 9 +++++++++
  17. meson.build | 4 +++-
  18. meson_options.txt | 4 ++++
  19. 4 files changed, 18 insertions(+), 1 deletion(-)
  20. diff --git a/Makefile.am b/Makefile.am
  21. index cc87392..d5d43e3 100644
  22. --- a/Makefile.am
  23. +++ b/Makefile.am
  24. @@ -162,6 +162,7 @@ pkgconfig_DATA += egl/wayland-egl.pc
  25. include_HEADERS += egl/wayland-egl-backend.h
  26. pkgconfig_DATA += egl/wayland-egl-backend.pc
  27. +if ENABLE_TESTS
  28. built_test_programs = \
  29. array-test \
  30. client-test \
  31. @@ -295,6 +296,7 @@ os_wrappers_test_LDADD = libtest-runner.la
  32. exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
  33. exec_fd_leak_checker_LDADD = libtest-helpers.la
  34. +endif
  35. EXTRA_DIST += tests/scanner-test.sh \
  36. protocol/tests.xml \
  37. diff --git a/configure.ac b/configure.ac
  38. index dda5e48..99b7c96 100644
  39. --- a/configure.ac
  40. +++ b/configure.ac
  41. @@ -77,6 +77,13 @@ AC_ARG_ENABLE([libraries],
  42. [],
  43. [enable_libraries=yes])
  44. +AC_ARG_ENABLE([tests],
  45. + [AC_HELP_STRING([--disable-tests],
  46. + [Disable compilation of test programs])],
  47. + [],
  48. + [enable_tests=yes])
  49. +
  50. +
  51. AC_ARG_WITH([host-scanner],
  52. [AC_HELP_STRING([--with-host-scanner],
  53. [Use installed wayland-scanner from host PATH during build])],
  54. @@ -99,6 +106,8 @@ AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
  55. AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
  56. +AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = xyes)
  57. +
  58. AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
  59. [ ICONDIR=$withval],
  60. [ ICONDIR=${datadir}/icons])
  61. diff --git a/meson.build b/meson.build
  62. index 5632f4e..b37bb7a 100644
  63. --- a/meson.build
  64. +++ b/meson.build
  65. @@ -83,7 +83,9 @@ subdir('src')
  66. if get_option('libraries')
  67. subdir('cursor')
  68. subdir('egl')
  69. - subdir('tests')
  70. + if get_option('tests')
  71. + subdir('tests')
  72. + endif
  73. endif
  74. if get_option('documentation')
  75. diff --git a/meson_options.txt b/meson_options.txt
  76. index 76314f7..ab4be92 100644
  77. --- a/meson_options.txt
  78. +++ b/meson_options.txt
  79. @@ -2,6 +2,10 @@ option('libraries',
  80. description: 'Compile Wayland libraries',
  81. type: 'boolean',
  82. value: 'true')
  83. +option('tests',
  84. + description: 'Compile Wayland tests',
  85. + type: 'boolean',
  86. + value: 'true')
  87. option('documentation',
  88. description: 'Build the documentation (requires Doxygen, dot, xmlto, xsltproc)',
  89. type: 'boolean',
  90. --
  91. 2.20.1