From e66b563d35bae3acab5f0d64eaee52bfc40ce22b Mon Sep 17 00:00:00 2001 From: Shockingly Good Date: Wed, 4 Dec 2024 17:17:20 +0100 Subject: [PATCH 1/3] Use the absolute path for the valgrind log file This fixes the issue when the relative path is provided, which causes the process not starting correctly and the tests - failing. --- RLTest/debuggers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RLTest/debuggers.py b/RLTest/debuggers.py index 36836d82..02a14101 100644 --- a/RLTest/debuggers.py +++ b/RLTest/debuggers.py @@ -25,7 +25,7 @@ def generate_command(self, logfile=None): if self.suppressions: cmd += ['--suppressions=' + self.suppressions] if logfile: - cmd += ['--log-file=' + logfile] + cmd += ['--log-file=' + os.path.abspath(logfile)] return cmd From b5141b7c6ee8d0f44c3c537551e56d9d3a853d31 Mon Sep 17 00:00:00 2001 From: Victor Polevoy Date: Thu, 5 Dec 2024 10:08:25 +0100 Subject: [PATCH 2/3] Use the absolute path for the valgrind suppressions --- RLTest/debuggers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RLTest/debuggers.py b/RLTest/debuggers.py index 02a14101..54e252cb 100644 --- a/RLTest/debuggers.py +++ b/RLTest/debuggers.py @@ -23,7 +23,7 @@ def generate_command(self, logfile=None): if '--errors-for-leak-kinds=definite' not in self.options: cmd += ['--errors-for-leak-kinds=definite'] if self.suppressions: - cmd += ['--suppressions=' + self.suppressions] + cmd += ['--suppressions=' + os.path.abspath(self.suppressions)] if logfile: cmd += ['--log-file=' + os.path.abspath(logfile)] return cmd From f54c2f022dd860f8251087d93b1244d28888a244 Mon Sep 17 00:00:00 2001 From: Victor Polevoy Date: Thu, 5 Dec 2024 10:10:50 +0100 Subject: [PATCH 3/3] Adapt the test --- tests/unit/test_debuggers.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/unit/test_debuggers.py b/tests/unit/test_debuggers.py index 44cde202..d4c8a272 100644 --- a/tests/unit/test_debuggers.py +++ b/tests/unit/test_debuggers.py @@ -13,11 +13,13 @@ def test_generate_command_default(self): def test_generate_command_supression(self): default_valgrind = Valgrind(options="", suppressions="file") cmd_args = default_valgrind.generate_command() - assert ['valgrind', '--error-exitcode=255', '--leak-check=full', '--errors-for-leak-kinds=definite', - '--suppressions=file'] == cmd_args + assert ['valgrind', '--error-exitcode=255', '--leak-check=full', '--errors-for-leak-kinds=definite'] == cmd_args[:4] + assert '--suppressions=' in cmd_args[4] + assert 'file' in cmd_args[4] def test_generate_command_logfile(self): default_valgrind = Valgrind(options="") cmd_args = default_valgrind.generate_command('logfile') - assert ['valgrind', '--error-exitcode=255', '--leak-check=full', '--errors-for-leak-kinds=definite', - '--log-file=logfile'] == cmd_args + assert ['valgrind', '--error-exitcode=255', '--leak-check=full', '--errors-for-leak-kinds=definite'] == cmd_args[:4] + assert '--log-file=' in cmd_args[4] + assert 'logfile' in cmd_args[4]