aboutsummaryrefslogtreecommitdiffstats
path: root/ctest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'ctest/CMakeLists.txt')
-rw-r--r--ctest/CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/ctest/CMakeLists.txt b/ctest/CMakeLists.txt
index 6ee2e10..c8cdbbb 100644
--- a/ctest/CMakeLists.txt
+++ b/ctest/CMakeLists.txt
@@ -26,6 +26,20 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Ctest configuration variables must be set BEFORE include(Ctest)
+
+# Check process children and give detail for each leak
+set(MEMORYCHECK_COMMAND_OPTIONS
+ "${MEMORYCHECK_COMMAND_OPTIONS} --trace-children=yes --leak-check=full")
+
+# As dash is not used to submit results, there is no way to see valgrind result.
+# Force it to log to stderr and fail in case of leak or error.
+set(MEMORYCHECK_COMMAND_OPTIONS
+ "${MEMORYCHECK_COMMAND_OPTIONS} --error-exitcode=255 --log-fd=2")
+
+# Ignore errors from third-partie libraries
+set(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_CURRENT_LIST_DIR}/valgrind.supp")
+
# Enable tests, coverage, memcheck, ...
# See http://www.cmake.org/Wiki/CMake/Testing_With_CTest#Dashboard_Preparation
include(CTest)