forked from suketa/ruby-duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
41 lines (32 loc) · 910 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'bundler/gem_tasks'
require 'rake/testtask'
ruby_memcheck_avaiable = begin
require 'ruby_memcheck'
true
rescue LoadError
false
end
if ruby_memcheck_avaiable
RubyMemcheck.config(
binary_name: 'duckdb/duckdb_native',
valgrind_options: ['--max-threads=1000']
)
end
test_config = lambda do |t|
t.libs << 'test'
t.libs << 'lib'
t.test_files = FileList['test/**/*_test.rb']
end
Rake::TestTask.new(test: :compile, &test_config)
if ruby_memcheck_avaiable
namespace :test do
RubyMemcheck::TestTask.new(valgrind: :compile, &test_config)
end
end
require 'rake/extensiontask'
task build: :compile
Rake::ExtensionTask.new('duckdb_native') do |ext|
ext.ext_dir = 'ext/duckdb'
ext.lib_dir = 'lib/duckdb'
end
task default: %i[clobber compile test]