Created
July 4, 2016 15:17
-
-
Save prathmeshranaut/565f78ceacaab9644c738900c3a5a9e0 to your computer and use it in GitHub Desktop.
Added Line 7-11 to allow benchmark a specific file only
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "timeout" | |
desc "Run Celluloid benchmarks" | |
task :benchmark do | |
begin | |
Timeout.timeout(120) do | |
if ENV['FILE'] | |
glob = File.expand_path("../../benchmarks/#{ENV['FILE']}.rb", __FILE__) | |
else | |
glob = File.expand_path("../../benchmarks/*.rb", __FILE__) | |
end | |
Dir[glob].each { |benchmark| load benchmark } | |
end | |
rescue ::Exception, Timeout::Error => ex | |
puts "ERROR: Couldn't complete benchmark: #{ex.class}: #{ex}" | |
puts " #{ex.backtrace.join("\n ")}" | |
exit 1 unless ENV["CI"] # Hax for running benchmarks on Travis | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added Line 7-11 to allow benchmark a specific file only.
if ENV['FILE'] glob = File.expand_path("../../benchmarks/#{ENV['FILE']}.rb", __FILE__) else glob = File.expand_path("../../benchmarks/*.rb", __FILE__) end
Should I create a pull request for this?