-
Notifications
You must be signed in to change notification settings - Fork 32
/
Rakefile
69 lines (54 loc) · 1.89 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# encoding: utf-8
require 'rubygems' unless defined?(Gem)
require 'rake' unless defined?(Rake)
# Prefer compiled Rubinius bytecode in .rbx/
ENV["RBXOPT"] = "-Xrbc.db"
require 'rake/extensiontask'
require 'rake/testtask'
require 'rdoc/task'
gemspec = Gem::Specification.load('rbczmq.gemspec')
Gem::PackageTask.new(gemspec) do |pkg|
end
Rake::ExtensionTask.new('rbczmq', gemspec) do |ext|
ext.name = 'rbczmq_ext'
ext.ext_dir = 'ext/rbczmq'
CLEAN.include 'ext/rbczmq/dst'
CLEAN.include 'lib/**/rbczmq_ext.*'
end
Rake::RDocTask.new do |rd|
files = FileList["README.rdoc", "lib/**/*.rb", "ext/rbczmq/*.c"]
rd.title = "rbczmq - binding for the high level ZeroMQ C API"
rd.main = "README.rdoc"
rd.rdoc_dir = "doc"
rd.options << "--promiscuous"
rd.rdoc_files.include(files)
end
desc 'Run rbczmq tests'
Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = "test/**/test_*.rb"
t.verbose = true
t.warning = true
end
namespace :debug do
desc "Run the test suite under gdb"
task :gdb do
system "gdb --args ruby rake"
end
desc "Run the test suite under valgrind"
task :valgrind do
valgrind_opts = "--num-callers=5 --error-limit=no --partial-loads-ok=yes --undef-value-errors=no --leak-check=full"
system %[valgrind #{valgrind_opts} ruby -w -I"lib" -I"/Users/lourens/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2/lib" "/Users/lourens/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2/lib/rake/rake_test_loader.rb" "test/test_context.rb" "test/test_frame.rb" "test/test_loop.rb" "test/test_message.rb" "test/test_socket.rb" "test/test_threading.rb" "test/test_timer.rb" "test/test_zmq.rb"]
end
end
desc 'Clobber Rubinius .rbc files'
task :clobber_rbc do
sh 'find . -name *.rbc -print0 | xargs -0 rm'
end
desc "setup the vendored libzmq && czmq source"
task :checkout do
sh "git submodule update --init"
end
task :compile => :checkout
task :test => :compile
task :default => :test