Remove -DNDEBUG from CFLAGS for tests ENGINE-259
authorDamiano Boppart <damiano@pep-security.net>
Tue, 19 Sep 2017 14:45:53 +0200
branchENGINE-259
changeset 2073b4126ce1af67
parent 2072 ecc35092791d
child 2074 817d6f5e8f48
Remove -DNDEBUG from CFLAGS for tests
build-config/common.conf
test/Makefile
     1.1 --- a/build-config/common.conf	Tue Sep 19 14:43:00 2017 +0200
     1.2 +++ b/build-config/common.conf	Tue Sep 19 14:45:53 2017 +0200
     1.3 @@ -27,6 +27,8 @@
     1.4  ######### C #########
     1.5  #CC This option is platform-specific
     1.6  CPPFLAGS=
     1.7 +# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
     1.8 +# The tests do not work properly, if compiled with -DNDEBUG
     1.9  #CFLAGS This option is platform-specific
    1.10  # Additional CFLAGS used for compiling ASN1C-generated code
    1.11  #CFLAGS_GENERATED This option is platform-specific
     2.1 --- a/test/Makefile	Tue Sep 19 14:43:00 2017 +0200
     2.2 +++ b/test/Makefile	Tue Sep 19 14:45:53 2017 +0200
     2.3 @@ -57,6 +57,8 @@
     2.4  UNIT_TESTS=$(subst .cc,,$(UNIT_TESTS_SOURCE))
     2.5  UNIT_TESTS_RUN=$(subst .cc,_run,$(UNIT_TESTS_SOURCE))
     2.6  
     2.7 +CFLAGS=$(filter-out -DNDEBUG,$(CFLAGS))
     2.8 +
     2.9  ifneq ($(MAKECMDGOALS),clean)
    2.10      ifneq (,$(findstring -DNDEBUG,$(CFLAGS)))
    2.11          $(error The macro NDEBUG must not be defined for test compilation.)