test: Replace "/proc/self/exe" with path to test binary

When tests are run under valgrind, /proc/self/exe points to valgrind,
not to the test binary. This results in failures for tests that need to
fork processes. Fix it by replacing "/proc/self/exe" with the path to
the test binary.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2021-11-29 23:16:35 +02:00
parent b24d9c4413
commit 59002a9e9d
5 changed files with 7 additions and 8 deletions

View file

@ -173,7 +173,7 @@ protected:
int run()
{
ipc_ = std::make_unique<IPCPipeUnixSocket>("", "/proc/self/exe");
ipc_ = std::make_unique<IPCPipeUnixSocket>("", self().c_str());
if (!ipc_->isConnected()) {
cerr << "Failed to create IPCPipe" << endl;
return TestFail;