2
1

0001-Build-unit-tests-only-when-enable-unit-tests-is-pass.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From ae92a466e203c8aec43f682a3a7aa617b820c3ba Mon Sep 17 00:00:00 2001
  2. From: Sergio Prado <sergio.prado@e-labworks.com>
  3. Date: Sat, 10 Apr 2021 11:03:38 -0300
  4. Subject: [PATCH] Build unit tests only when --enable-unit-tests is passed
  5. Building unit tests by default requires all dependencies to be
  6. installed (jpeg, tiff, etc) and users may not want that.
  7. So let's disable the build of unit tests by default and introduce
  8. --enable-unit-tests configure option to enable it.
  9. Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
  10. Upstream: https://github.com/mono/libgdiplus/pull/701
  11. [Dario: make the patch to be applied with fuzz factor 0]
  12. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
  13. ---
  14. Makefile.am | 8 ++++++--
  15. configure.ac | 4 ++++
  16. 2 files changed, 10 insertions(+), 2 deletions(-)
  17. diff --git a/Makefile.am b/Makefile.am
  18. index f40bdee0c2e9..152e0d64fdd9 100644
  19. --- a/Makefile.am
  20. +++ b/Makefile.am
  21. @@ -1,7 +1,11 @@
  22. ACLOCAL_AMFLAGS = -I m4
  23. -SUBDIRS = src tests
  24. -DIST_SUBDIRS = src tests
  25. +if BUILD_UNIT_TESTS
  26. +SUBDIRS_TESTS = tests
  27. +endif
  28. +
  29. +SUBDIRS = src $(SUBDIRS_TESTS)
  30. +DIST_SUBDIRS = src $(SUBDIRS_TESTS)
  31. pkgconfigdir = $(libdir)/pkgconfig
  32. diff --git a/configure.ac b/configure.ac
  33. index 098fd0a664bd..c126ff091e58 100644
  34. --- a/configure.ac
  35. +++ b/configure.ac
  36. @@ -47,6 +47,10 @@
  37. GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Werror -Wno-unknown-warning-option -Wno-clobbered"
  38. fi
  39. +AC_ARG_ENABLE(unittests, AS_HELP_STRING([--enable-unittests],[Enable building unit tests.]),[unittests=yes],[unittests=no])
  40. +
  41. +AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$unittests = xyes])
  42. +
  43. AC_ARG_ENABLE(asan, AS_HELP_STRING([--enable-asan],[Enable address sanitizer.]),[asan=yes],[asan=no])
  44. if test $asan = "yes"; then
  45. --
  46. 2.17.1