module Minitest

def self.autorun

def self.autorun
  if Object.const_defined?(:Warning) && Warning.respond_to?(:[]=)
    Warning[:deprecated] = true
  end
  at_exit {
    next if $! and not ($!.kind_of? SystemExit and $!.success?)
    exit_code = nil
    pid = Process.pid
    at_exit {
      next if Process.pid != pid
      @@after_run.reverse_each(&:call)
      exit exit_code || false
    }
    exit_code = Minitest.run ARGV
  } unless @@installed_at_exit
  @@installed_at_exit = true
end