[libcamera-devel,v1,0/2] libcamera: Fix valgrind usage with tests that fork process
mbox series

Message ID 20211130012303.10574-1-laurent.pinchart@ideasonboard.com
Headers show
Series
  • libcamera: Fix valgrind usage with tests that fork process
Related show

Message

Laurent Pinchart Nov. 30, 2021, 1:23 a.m. UTC
Hello,

This small seris fixes unit tests to enable running tests that fork a
process under valgrind.

The issue is that those tests attempt to fork and exec themselves
through /proc/self/exe. While this works in normal circumstances, when
run under valgrind /proc/self/exe is valgrind itself, not the test
binary. 

Laurent Pinchart (2):
  test: Store path to the test executable in Test class
  test: Replace "/proc/self/exe" with path to test binary

 test/file.cpp                 |  4 ++--
 test/ipc/unixsocket.cpp       |  9 +++++----
 test/ipc/unixsocket_ipc.cpp   |  6 ++++--
 test/libtest/test.cpp         |  5 +++++
 test/libtest/test.h           | 15 ++++++++++++---
 test/log/log_process.cpp      |  6 ++++--
 test/process/process_test.cpp |  7 ++++---
 7 files changed, 36 insertions(+), 16 deletions(-)


base-commit: 8178e01b36d767e05d7bbb9dd1f752f7ede0db3d