exe/benchmark-driver in benchmark_driver-0.4.0 vs exe/benchmark-driver in benchmark_driver-0.4.1

- old
+ new

@@ -32,15 +32,18 @@ options[:repeat_count] = Integer(v) rescue ArgumentError abort "-r, --repeat-count must take Integer, but got #{v.inspect}" end 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? -args.each do |yaml| - yaml = YAML.load(File.read(yaml)) +args.each do |path| + yaml = YAML.load(File.read(path)) Benchmark::Driver::Configuration.symbolize_keys!(yaml) begin config = Benchmark::Driver::YamlParser.parse(yaml) rescue ArgumentError @@ -52,9 +55,14 @@ options.each do |key, value| case key when :compare config.output_options.compare = value + when :dir + dir = File.dirname(path) + config.jobs.each do |job| + job.prelude = "__dir__ = #{dir.dump}.freeze; #{job.prelude}" + end when :execs config.runner_options.executables = value when :repeat_count config.runner_options.repeat_count = value else