forked from arthurnn/memcached
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
52 lines (43 loc) · 1.2 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
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rake/extensiontask'
spec = Gem::Specification.load('memcached.gemspec')
Rake::ExtensionTask.new('memcached', spec) do |ext|
ext.lib_dir = 'lib'
end
Rake::TestTask.new do |t|
t.libs << 'lib' << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
t.warning = true
end
task :default => [:compile, :test]
task :exceptions do
$LOAD_PATH << "lib"
require 'memcached'
Memcached.constants.sort.each do |const_name|
const = Memcached.send(:const_get, const_name)
next if const == Memcached::Success or const == Memcached::Stored
if const.is_a? Class and const < Memcached::Error
puts "* Memcached::#{const_name}"
end
end
end
task :benchmark do
exec("ruby #{File.dirname(__FILE__)}/test/profile/benchmark.rb")
end
task :rb_profile do
exec("ruby #{File.dirname(__FILE__)}/test/profile/rb_profiler.rb")
end
task :c_profile do
exec("ruby #{File.dirname(__FILE__)}/test/profile/c_profiler.rb")
end
task :valgrind do
exec("ruby #{File.dirname(__FILE__)}/test/profile/valgrind.rb")
end
task :prerelease => [:manifest, :test, :install]
def run(cmd, reason)
puts reason
puts cmd
raise "'#{cmd}' failed" unless system(cmd)
end