A Hoe plugin to help you debug your C extensions. This plugin provides
test:valgrind tasks (plus a few variants). As of v1.5 it also can generate a valgrind suppression from a previous test suite's log file.
Hoe::Debugging module for a few configuration options.
This plugin expects you to have
valgrind available in your
In your Rakefile:
Then you'll get the following rake tasks:
rake test:valgrind # debugging # Run the test suite under Valgrind rake test:valgrind:mem # debugging # Run the test suite under Valgrind with memory-fill rake test:valgrind:mem0 # debugging # Run the test suite under Valgrind with memory-zero rake test:valgrind:suppression # debugging # Generate a valgrind suppression file for your test suite rake valgrind:suppression[file] # debugging # Generate a valgrind suppression file from a previous run's log file
Run your test suite under gdb:
Run your test suite with valgrind's memcheck:
If you have repeatable valgrind warnings that you've decided it's OK to suppress:
rake test:valgrind:suppression rake test:valgrind # when this runs, the previous run's errors will be suppressed
If you have a log file containing hard-to-reproduce valgrind warnings (e.g., from CI) that you've decided it's OK to suppress:
rake valgrind:suppression[path/to/file] rake test:valgrind # when this runs, the errors from that log file will be suppressed
Suppression files can be added to the
suppressions subdirectory of your project.
As of v2.0.0,
hoe-debugging will use all suppression files that match any part of your Ruby's version. It uses the Hoe project name and the ruby version name, with an optional trailing
For example, if:
- my Hoe project was named
- and my Ruby version was
then the following would be found and used:
and the following would not be used:
suppressions/otherproject_ruby-22.214.171.124.suppbecause the project name is wrong
suppressions/myproject_ruby-126.96.36.199.suppbecause the patchlevel is wrong
suppressions/myproject_ruby-2.5.2.suppbecause the patch is wrong
suppressions/myproject_ruby-2.4.suppbecause the minor is wrong
suppressions/myproject_ruby-1.suppbecause the major is wrong
$ gem install hoe-debugging
You should also use your distro's package manager to install
LICENSE file in this repository.