# File lib/autotest.rb, line 449
  def make_test_cmd files_to_test
    cmds = []
    full, partial = reorder(files_to_test).partition { |k,v| v.empty? }
    base_cmd = "#{bundle_exec}#{ruby} -I#{libs} -rubygems"

    unless full.empty? then
      files = full.map {|k,v| k}.flatten.uniq
      if options[:parallel] and files.size > 1
        files = files.map{|file| File.expand_path(file) } if RUBY19
        cmds << "#{bundle_exec}parallel_test #{escape_filenames(files).join(' ')}"
      else
        files.unshift testlib
        cmds << "#{base_cmd} -e \"[#{escape_filenames(files).join(', ')}].each { |f| require f }\" | #{unit_diff}"
      end
    end

    partial.each do |klass, methods|
      regexp = Regexp.union(*methods).source
      cmds << "#{base_cmd} #{klass} -n \"/^(#{regexp})$/\" | #{unit_diff}"
    end

    cmds.join("#{SEP} ")
  end