class MiniTest::Unit

def run args = []

def run args = []
  options = process_args args
  @verbose = options[:verbose]
  filter = options[:filter] || '/./'
  filter = Regexp.new $1 if filter and filter =~ /\/(.*)\//
  seed = options[:seed]
  unless seed then
    srand
    seed = srand % 0xFFFF
  end
  srand seed
  @@out.puts "Loaded suite #{$0.sub(/\.rb$/, '')}\nStarted"
  start = Time.now
  run_test_suites filter
  @@out.puts
  @@out.puts "Finished in #{'%.6f' % (Time.now - start)} seconds."
  @report.each_with_index do |msg, i|
    @@out.puts "\n%3d) %s" % [i + 1, msg]
  end
  @@out.puts
  status
  @@out.puts
  help = ["--seed", seed]
  help.push "--verbose" if @verbose
  help.push("--name", options[:filter].inspect) if options[:filter]
  @@out.puts "Test run options: #{help.join(" ")}"
  return failures + errors if @test_count > 0 # or return nil...
rescue Interrupt
  abort 'Interrupted'
end