Skip to content

Commit 1bdd470

Browse files
committed
Setup ruby_memcheck
Hoping it might find the leak reported in ruby#460
1 parent 942cd3f commit 1bdd470

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.github/workflows/ci.yml

+23
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,26 @@ jobs:
5656

5757
- run: gem install pkg/*.gem
5858
if: ${{ matrix.ruby != '3.2' }}
59+
60+
valgrind:
61+
name: Ruby memcheck
62+
runs-on: ubuntu-latest
63+
strategy:
64+
fail-fast: false
65+
66+
steps:
67+
- uses: actions/checkout@v3
68+
69+
- name: Set up Ruby
70+
uses: ruby/setup-ruby-pkgs@v1
71+
with:
72+
ruby-version: "3.3"
73+
apt-get: ragel valgrind
74+
75+
- run: |
76+
bundle config --without benchmark
77+
bundle install
78+
79+
- run: rake compile
80+
81+
- run: rake valgrind

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ else
77
end
88

99
group :development do
10+
gem "ruby_memcheck" if RUBY_PLATFORM =~ /linux/i
1011
gem "ostruct"
1112
gem "rake"
1213
gem "rake-compiler"

Rakefile

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "ruby_memcheck"
2+
13
begin
24
require 'rubygems/package_task'
35
rescue LoadError
@@ -250,6 +252,12 @@ else
250252
t.options = '-v'
251253
end
252254

255+
RubyMemcheck::TestTask.new(valgrind: [ :set_env_ext, :check_env, :compile, :do_test_ext ]) do |t|
256+
t.test_files = FileList['test/json/*_test.rb']
257+
t.verbose = true
258+
t.options = '-v'
259+
end
260+
253261
desc "Update the tags file"
254262
task :tags do
255263
system 'ctags', *Dir['**/*.{rb,c,h,java}']

0 commit comments

Comments
 (0)