Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit a5a1c72

Browse files
add note how to run valgrind tests without libunwind
1 parent 1f61bcf commit a5a1c72

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ option(CHECK_CPP_STYLE "check code style of C++ sources" OFF)
7878
option(TRACE_TESTS "more verbose test outputs" OFF)
7979
option(USE_ASAN "enable AddressSanitizer (debugging)" OFF)
8080
option(USE_UBSAN "enable UndefinedBehaviorSanitizer (debugging)" OFF)
81-
option(USE_LIBUNWIND "use libunwind for more reliable stack traces from tests (if available)" ON)
81+
option(USE_LIBUNWIND "use libunwind for more reliable stack traces from tests (if available); see README file if tests fail with libunwind" ON)
8282
option(USE_CCACHE "use ccache if it is available in the system" ON)
8383

8484
option(TESTS_USE_FORCED_PMEM "run tests with PMEM_IS_PMEM_FORCE=1 - it speeds up tests execution on emulated pmem" OFF)

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,24 @@ $ make
9797
# make install
9898
```
9999

100+
**Note:**
101+
By default CMake's option `USE_LIBUNWIND` is switched ON. If libunwind package was found
102+
in the system, it is then linked to all tests' binaries. Sometimes this may lead to
103+
failing a test, if it is run under Valgrind. To avoid this false-positive fails, you can
104+
execute tests run under Valgrind separately, without libunwind:
105+
106+
```sh
107+
cmake .. -DTESTS_USE_VALGRIND=ON -DUSE_LIBUNWIND=OFF && \
108+
ctest -R "_helgrind|_pmemcheck|_drd|_memcheck|_pmreorder" # run only valgrind tests
109+
```
110+
111+
or valgrind tests can be disabled in CMake build:
112+
113+
```sh
114+
cmake .. -DTESTS_USE_VALGRIND=OFF && \
115+
ctest
116+
```
117+
100118
### Developer compilation
101119
```sh
102120
$ mkdir build

utils/docker/run-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ TESTS_PACKAGES=${TESTS_PACKAGES:-ON}
2323
TESTS_USE_FORCED_PMEM=${TESTS_USE_FORCED_PMEM:-ON}
2424
TESTS_ASAN=${TESTS_ASAN:-OFF}
2525
TESTS_UBSAN=${TESTS_UBSAN:-OFF}
26-
TESTS_VALGRIND_UNWIND=${TESTS_VALGRIND_UNWIND:-OFF}
26+
TESTS_VALGRIND_UNWIND=${TESTS_VALGRIND_UNWIND:-OFF} # turn unwind off, when building with valgrind tests=ON
2727
TEST_TIMEOUT=${TEST_TIMEOUT:-600}
2828

2929
export PMREORDER_STACKTRACE_DEPTH=20

0 commit comments

Comments
 (0)