-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
36 lines (29 loc) · 926 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
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rspec/core/rake_task"
desc "Run all the tests in spec"
RSpec::Core::RakeTask.new(:spec)
desc "Running all the benchmarks and writing results to file"
task :benchmark do
STDOUT.puts("Benchmarking:")
Dir[File.join(File.dirname(__FILE__), "bench", "**", "*.rb")].each do |benchmark|
STDOUT.puts("---")
STDOUT.puts(`bundle exec ruby #{benchmark}`.gsub("\t", " ").gsub("---", ""))
end
end
desc "Run all profiling tests"
task :profile do
Dir[File.join(File.dirname(__FILE__), "prof", "**", "*.rb")].each do |profile|
`bundle exec ruby #{profile}`
end
end
desc "Note each result in a git-note"
task :record do
`git notes add -f -m "\`bundle exec rake benchmark\`"`
end
desc "Compare current versus last commit"
task :compare do
system "diff -u <(git notes show) <(bundle exec rake benchmark)"
end
desc "Default: run tests"
task default: :spec