From 59002a9e9d84417197999391c7d8c6af620fc1fb Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Mon, 29 Nov 2021 23:16:35 +0200
Subject: 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>
---
 test/process/process_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'test/process')

diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp
index 96bea17f..b410756b 100644
--- a/test/process/process_test.cpp
+++ b/test/process/process_test.cpp
@@ -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;
-- 
cgit v1.2.1