build BUGFIX allow disabling tests for debug build
... by disabling just the single option.
@@ -230,12 +230,15 @@ if(ENABLE_STATIC)
endif()
if(ENABLE_VALGRIND_TESTS)
+ if(NOT ENABLE_TESTS)
+ message(WARNING "Tests are disabled! Disabling memory leak tests.")
+ set(ENABLE_VALGRIND_TESTS OFF)
+ else()
find_program(VALGRIND_FOUND valgrind)
if(NOT VALGRIND_FOUND)
- message(WARNING "valgrind executable not found! Disabling memory leaks tests.")
+ message(WARNING "valgrind executable not found! Disabling memory leak tests.")
set(ENABLE_VALGRIND_TESTS OFF)
- else()
- set(ENABLE_TESTS ON)
+ endif()
endif()
endif()
@@ -245,7 +248,7 @@ if(ENABLE_TESTS)
message(STATUS "Disabling tests because of missing CMocka")
set(ENABLE_TESTS OFF)
endif()
-endif(ENABLE_TESTS)
+endif()
if(ENABLE_COVERAGE)
gen_coverage_enable(${ENABLE_TESTS})
