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

@ -55,7 +55,7 @@ protected:
proc_.kill();
/* Test starting the process and retrieving the exit code. */
int ret = proc_.start("/proc/self/exe", args);
int ret = proc_.start(self(), args);
if (ret) {
cerr << "failed to start process" << endl;
return TestFail;