-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
47 lines (41 loc) · 991 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
42
43
44
45
46
47
require "bundler/gem_tasks"
desc "Run test"
task :test do
ruby("run-test.rb")
end
task :default => :test
benchmark_tasks = []
namespace :benchmark do
Dir.glob("benchmark/*.yaml") do |yaml|
name = File.basename(yaml, ".*")
env = {
"RUBYLIB" => nil,
"BUNDLER_ORIG_RUBYLIB" => nil,
}
command_line = [
FileUtils::RUBY, "-v", "-S", "benchmark-driver", File.expand_path(yaml),
]
desc "Run #{name} benchmark"
task name do
puts("```")
sh(env, *command_line)
puts("```")
end
benchmark_tasks << "benchmark:#{name}"
case name
when /\Aparse/, "shift"
namespace name do
desc "Run #{name} benchmark: small"
task :small do
puts("```")
sh(env.merge("N_COLUMNS" => "10"),
*command_line)
puts("```")
end
benchmark_tasks << "benchmark:#{name}:small"
end
end
end
end
desc "Run all benchmarks"
task :benchmark => benchmark_tasks