-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: use ruby_memcheck for a valgrind test task
- Loading branch information
1 parent
69c9fa7
commit 67fc6e6
Showing
3 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
source "https://rubygems.org" | ||
|
||
gemspec | ||
|
||
gem("minitest", "~> 5.15") | ||
gem("rake-compiler", "~> 1.2.0") | ||
gem("rake-compiler-dock", "1.3.0") | ||
gem("rdoc", ">= 4.0", "< 7") | ||
gem("psych", "~> 4.0") # psych 5 doesn't build on some CI platforms yet | ||
|
||
gem("ruby_memcheck") if Gem::Platform.local.os == "linux" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
require "rake/testtask" | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
test_config = lambda do |t| | ||
t.libs << "test" | ||
t.libs << "lib" | ||
t.test_files = FileList["test/**/test_*.rb"] | ||
end | ||
|
||
Rake::TestTask.new(:test, &test_config) | ||
|
||
begin | ||
require "ruby_memcheck" | ||
|
||
RubyMemcheck.config(binary_name: "sqlite3_native") | ||
|
||
namespace :test do | ||
RubyMemcheck::TestTask.new(:valgrind, &test_config) | ||
end | ||
rescue LoadError => e | ||
warn("NOTE: ruby_memcheck is not available in this environment: #{e}") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters