Sha256: 62d1b9096ccd70391ddde8aa004e3ed9fc11e9262ea56aa52dd777dd1d8bb45b

Contents?: true

Size: 1019 Bytes

Versions: 27

Compression:

Stored size: 1019 Bytes

Contents

module Multiverse
  module Runner
    extend self
    extend Color

    def exit_status
      @exit_status ||= 0
    end

    def notice_exit_status(i)
      exit_status # initialize it
      # we don't want to return exit statuses > 256 since these get converted
      # to 0
      if i != 0
        puts red("FAIL! Exited #{i}")
        @exit_status = 1
      else
        puts green("PASS. Exited #{i}")
      end
      @exit_status
    end

    def run(filter="")
      Dir.new(SUITES_DIRECTORY).entries.each do |dir|
        next if dir =~ /\A\./
        next unless dir.include? filter
        full_path = File.join(SUITES_DIRECTORY, dir)
        begin
          suite = Suite.new full_path
          suite.execute
        rescue => e
          puts red("Error when trying to run suite in #{full_path.inspect}")
          puts
          puts "#{e.class}: #{e}"
          puts *e.backtrace
          notice_exit_status 1
        end
      end

      OutputCollector.report
      exit exit_status
    end
  end
end

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
newrelic_rpm-3.5.4.34 test/multiverse/lib/multiverse/runner.rb
newrelic_rpm-3.5.4.33 test/multiverse/lib/multiverse/runner.rb
newrelic_rpm-3.5.4.31.beta test/multiverse/lib/multiverse/runner.rb
newrelic_rpm-3.5.4.29.beta test/multiverse/lib/multiverse/runner.rb
ghazel-newrelic_rpm-3.5.4 test/multiverse/lib/multiverse/runner.rb
newrelic_rpm-3.5.3.25 test/multiverse/lib/multiverse/runner.rb
newrelic_rpm-3.5.3.24 test/multiverse/lib/multiverse/runner.rb