module ParallelTests::Tasks

def run_in_parallel(cmd, options = {})

def run_in_parallel(cmd, options = {})
  load_lib
  # Using the relative path to find the binary allow to run a specific version of it
  executable = File.expand_path('../../bin/parallel_test', __dir__)
  command = ParallelTests.with_ruby_binary(executable)
  command += ['--exec', Shellwords.join(cmd)]
  command += ['-n', options[:count]] unless options[:count].to_s.empty?
  command << '--non-parallel' if options[:non_parallel]
  abort unless system(*command)
end