Skip to content

Commit

Permalink
Merge pull request #229 from RedisLabsModules/fix-valgrind-log-file-path
Browse files Browse the repository at this point in the history
Use the absolute path for the valgrind log file
  • Loading branch information
iddm authored Dec 5, 2024
2 parents a80e0ec + f54c2f0 commit 60e3290
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions RLTest/debuggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ 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=' + logfile]
cmd += ['--log-file=' + os.path.abspath(logfile)]
return cmd


Expand Down
10 changes: 6 additions & 4 deletions tests/unit/test_debuggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit 60e3290

Please sign in to comment.