# File lib/kwala/actions/code_coverage.rb, line 274
  def run_test_cases(context)
    test_files = context.test_files.dup.map {|file| File.expand_path(file)}

    o_dir = File.expand_path("#{File.expand_path(context.output_directory)}/coverage/aggregate")
    puts o_dir
    if File.exists?(o_dir)
      FileUtils.rm_rf(o_dir)
    end
    FileUtils.mkdir(o_dir)

    rcov_data = Tempfile.new('rcov_aggregate').path

    one_file = test_files.shift

    # first do not generate html, just aggregate to rcov file data
    test_files.each do |file|
      # "No file to analyze was found" with just --no-html
      cmd = "#{RCOV} #{exclude_cmd(context)} --no-html -t --aggregate #{rcov_data} #{file}"
      puts cmd if DEBUG
      system(cmd)
    end

    # generate HTML for last file to be run
    cmd = "#{RCOV} #{exclude_cmd(context)} --aggregate #{rcov_data} -o #{o_dir} #{one_file}"
    system(cmd)

  end