module BenchmarkDriver
def build_contexts(contexts, executables:)
def build_contexts(contexts, executables:) # If contexts are not specified, just use executables as contexts. if !contexts.is_a?(Array) || contexts.empty? return executables.map { |exec| BenchmarkDriver::Context.new(name: exec.name, executable: exec) } end with_executables, without_executables = contexts.partition { |context| context.name && context.executable } with_executables + build_contexts_with_executables(without_executables, executables) end