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:
+2
-2
@@ -180,7 +180,7 @@ protected:
|
||||
}
|
||||
|
||||
/* Test size(). */
|
||||
file.setFileName("/proc/self/exe");
|
||||
file.setFileName(self());
|
||||
|
||||
if (file.size() >= 0) {
|
||||
cerr << "File has valid size before open" << endl;
|
||||
@@ -277,7 +277,7 @@ protected:
|
||||
file.close();
|
||||
|
||||
/* Test mapping and unmapping. */
|
||||
file.setFileName("/proc/self/exe");
|
||||
file.setFileName(self());
|
||||
file.open(File::OpenModeFlag::ReadOnly);
|
||||
|
||||
Span<uint8_t> data = file.map();
|
||||
|
||||
Reference in New Issue
Block a user