exe/benchmark-driver in benchmark_driver-0.4.2 vs exe/benchmark-driver in benchmark_driver-0.4.3
- old
+ new
@@ -32,10 +32,14 @@
options[:repeat_count] = Integer(v)
rescue ArgumentError
abort "-r, --repeat-count must take Integer, but got #{v.inspect}"
end
end
+ o.on('--filter [REGEXP]', 'Filter out benchmarks with given regexp') do |v|
+ abort '--filter can be used only once' if options.key?(:filter)
+ options[:filter] = v
+ end
o.on('--dir', 'Override __dir__ from "/tmp" to actual directory of YAML') do |v|
options[:dir] = v
end
end.parse!(ARGV)
abort "No YAML file is specified" if args.empty?
@@ -62,9 +66,14 @@
config.jobs.each do |job|
job.prelude = "__dir__ = #{dir.dump}.freeze; #{job.prelude}"
end
when :execs
config.runner_options.executables = value
+ when :filter
+ filter = Regexp.compile(value)
+ config.jobs.select! do |job|
+ job.name.match(filter)
+ end
when :repeat_count
config.runner_options.repeat_count = value
else
raise "Unhandled option: #{key.inspect}"
end