lib/benchmark_driver/runner/memory.rb in benchmark_driver-0.13.0 vs lib/benchmark_driver/runner/memory.rb in benchmark_driver-0.13.1

- old
+ new

@@ -60,11 +60,11 @@ # @param [BenchmarkDriver::Runner::Ips::Job] job - loop_count is not nil # @param [BenchmarkDriver::Context] context # @return [BenchmarkDriver::Metrics] def run_benchmark(job, context:) benchmark = BenchmarkScript.new( - prelude: "#{context.prelude}\n#{job.prelude}", + preludes: [context.prelude, job.prelude], script: job.script, teardown: job.teardown, loop_count: job.loop_count, ) @@ -101,11 +101,12 @@ # @param [String] prelude # @param [String] script # @param [String] teardown # @param [Integer] loop_count - BenchmarkScript = ::BenchmarkDriver::Struct.new(:prelude, :script, :teardown, :loop_count) do + BenchmarkScript = ::BenchmarkDriver::Struct.new(:preludes, :script, :teardown, :loop_count) do def render + prelude = preludes.reject(&:nil?).reject(&:empty?).join("\n") <<-RUBY #{prelude} #{while_loop(script, loop_count)} #{teardown} RUBY