Skip to content

Some memcheck notes #33

@mateuszpawlik

Description

@mateuszpawlik

I don't know what these notes are about so I put it in the issue :-) I found these in my local copy of the repo.

Memory checking using ctest

Basic setup

To quickly use memcheck with ctest, add include(CTest) instead of
#enable_testing(). Then use ctest as usually but add -T memcheck option.
This should execute each test with valgrind (I guess valgrind should be
installed first).

When ctest -T memcheck executed, the following output is possible when
memcheck finds problems. The valgrind details are in the log files.

...
-- Processing memory checking output:
62/62 MemCheck: #62: lgm_ub_lb_fill_gaps_test .......................................   Defects: 2
MemCheck log files can be found here: ( * corresponds to test number)
/home/mpawlik/Remote/tree-similarity/build/Testing/Temporary/MemoryChecker.*.log
Memory checking results:
Uninitialized Memory Read - 2
        Errors while running CTest

Ignoring tests for memcheck

In CmakeLists.txt corresponding to tests to be ignored add:

configure_file(
  CTestCustom.cmake
  ${CMAKE_BINARY_DIR}/CTestCustom.cmake
)

In file CTestCustom.cmake add tests to ignore when memcheck. I couldn't find
a way to use regex here.

list(
  APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
  ted_join_correctness_test_naivejoin_129
)

Then, when executing ctest, specified tests will be ignored.

Some test execution times

ctest 240 sec

ctest -R ted_join_correctness_test_ -T memcheck 105 sec

ctest -R ted_join_correctness_test_guhajoin 102 sec

ctest -T memcheck 1361 sec

ctest -R guha 107 sec

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions