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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 55ae8e1103f4697bfa01a84301a6560b89de5248 Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Mon, 16 Apr 2018 19:52:34 +0300
  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. Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
  11. Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>
  12. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  13. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
  14. ---
  15. Changes v1 -> v2:
  16. - fix typo in yes-check (Eric)
  17. ---
  18. Makefile.am | 2 ++
  19. configure.ac | 8 ++++++++
  20. 2 files changed, 10 insertions(+)
  21. diff --git a/Makefile.am b/Makefile.am
  22. index 741db5ebf9d9..4862d42959f0 100644
  23. --- a/Makefile.am
  24. +++ b/Makefile.am
  25. @@ -160,6 +160,7 @@ pkgconfig_DATA += egl/wayland-egl.pc
  26. include_HEADERS += egl/wayland-egl-backend.h
  27. pkgconfig_DATA += egl/wayland-egl-backend.pc
  28. +if ENABLE_TESTS
  29. built_test_programs = \
  30. array-test \
  31. client-test \
  32. @@ -287,6 +288,7 @@ os_wrappers_test_LDADD = libtest-runner.la
  33. exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
  34. exec_fd_leak_checker_LDADD = libtest-helpers.la
  35. +endif
  36. EXTRA_DIST += tests/scanner-test.sh \
  37. protocol/tests.xml \
  38. diff --git a/configure.ac b/configure.ac
  39. index c74ee97b24a2..5c94b7b76b06 100644
  40. --- a/configure.ac
  41. +++ b/configure.ac
  42. @@ -89,10 +89,18 @@ AC_ARG_ENABLE([dtd-validation],
  43. [],
  44. [enable_dtd_validation=yes])
  45. +AC_ARG_ENABLE([tests],
  46. + [AC_HELP_STRING([--disable-tests],
  47. + [Disable compilation of test programs])],
  48. + [],
  49. + [enable_tests=yes])
  50. +
  51. AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
  52. AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
  53. +AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = xyes)
  54. +
  55. AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
  56. [ ICONDIR=$withval],
  57. [ ICONDIR=${datadir}/icons])
  58. --
  59. 2.14.3