From a73dcfa3f50948b6c430d2b69e1464326ae88fe4 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 6 Oct 2024 15:36:25 -0700 Subject: [PATCH] Try valgrind --- .github/workflows/build.yml | 7 ++----- Gemfile | 1 + Rakefile | 7 ++++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7309b6d..b2188f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,10 +9,6 @@ jobs: include: - ruby: 3.3 os: ubuntu-22.04 - - ruby: 3.2 - os: macos-14 - - ruby: 3.1 - os: macos-13 steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 @@ -20,4 +16,5 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - run: bundle exec rake compile - - run: bundle exec rake test + - run: sudo apt-get update && sudo apt-get install valgrind + - run: bundle exec rake test:valgrind diff --git a/Gemfile b/Gemfile index 78e3274..b197916 100644 --- a/Gemfile +++ b/Gemfile @@ -5,3 +5,4 @@ gemspec gem "rake" gem "rake-compiler" gem "minitest", ">= 5" +gem "ruby_memcheck" diff --git a/Rakefile b/Rakefile index 21f95ce..54f72d6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,17 @@ require "bundler/gem_tasks" require "rake/testtask" require "rake/extensiontask" +require "ruby_memcheck" task default: :test -Rake::TestTask.new do |t| +test_config = lambda do |t| t.libs << "test" t.pattern = "test/**/*_test.rb" end +Rake::TestTask.new(:test, &test_config) +namespace :test do + RubyMemcheck::TestTask.new(:valgrind, &test_config) +end Rake::ExtensionTask.new("or-tools") do |ext| ext.name = "ext"