def filter_backtrace(backtrace)
      return [] unless backtrace
      bt, pwd = backtrace.dup, Dir.pwd
      unless $DEBUG
        bt = bt.reject do |line|
          $RUBY_IGNORE_CALLERS.any?{|re| re =~ line} unless line.start_with?(pwd)
        end
      end
      bt = backtrace if bt.empty?  # if empty just dump the whole thing
      bt.map{ |line| line.sub(pwd+'/', '') }
    end
def filter_backtrace(backtrace)
      return [] unless backtrace
      bt, pwd = backtrace.dup, Dir.pwd
      unless $DEBUG
        bt = bt.reject do |line|
          $RUBY_IGNORE_CALLERS.any?{|re| re =~ line} unless line.start_with?(pwd)
        end
      end
      bt = backtrace if bt.empty?  # if empty just dump the whole thing
      bt.map{ |line| line.sub(pwd+'/', '') }
    end
Filter backtrace of unimportant entries, and applies count limit if set in
 configuration. Setting $DEBUG to true will deactivate filter, or if the filter
 happens to remove all backtrace entries it will revert to the full backtrace,
 as that probably means there was an issue with the test harness itself.