Sha256: b8210f92885ada25fcc1fd990ab45ba42a3cd1775789a2d56ee456b8c520554b

Contents?: true

Size: 1.48 KB

Versions: 7

Compression:

Stored size: 1.48 KB

Contents

require 'test/unit/testsuite'
require 'test/unit/testcase'

$KCODE = 'UTF8'

rcsid = %w$Id$
Version = rcsid[2].scan(/\d+/).collect!(&method(:Integer)).freeze
Release = rcsid[3].freeze

module Test
  module Unit
    module Assertions
      alias assert_raise assert_raises
    end
  end
end

class BulkTestSuite < Test::Unit::TestSuite
  def self.suite
    suite = Test::Unit::TestSuite.new
    ObjectSpace.each_object(Class) do |klass|
      suite << klass.suite if (Test::Unit::TestCase > klass)
    end
    suite
  end
end

runners_map = {
  'console' => proc do |suite|
    require 'test/unit/ui/console/testrunner'
    passed = Test::Unit::UI::Console::TestRunner.run(suite).passed?
    exit(passed ? 0 : 1)
  end,
  'gtk' => proc do |suite|
    require 'test/unit/ui/gtk/testrunner'
    Test::Unit::UI::GTK::TestRunner.run(suite)
  end,
  'fox' => proc do |suite|
    require 'test/unit/ui/fox/testrunner'
    Test::Unit::UI::Fox::TestRunner.run(suite)
  end,
}

def test_require(list)
  list.each do |tc_name|
    if File.directory?(tc_name)
      newlist = Dir.glob(File.join(tc_name, "**", "test_*.rb")).sort
      test_require(newlist)
    else
      dir = File.expand_path(File.dirname(tc_name))
      backup = $:.dup
      $:.push(dir)
      require tc_name
      $:.replace(backup)
    end
  end
end

argv = ARGV
if argv.empty?
  argv = Dir.glob(File.join(File.dirname(__FILE__), "**", "test_*.rb")).sort
end

test_require(argv)

runner = 'console'
GC.start
runners_map[runner].call(BulkTestSuite.suite)

Version data entries

7 entries across 7 versions & 5 rubygems

Version Path
teo-soap4r-1.5.9b test/16runner.rb
soap4r-r19-1.5.9 test/16runner.rb
soap4r-sgonyea-1.6.0 test/16runner.rb
soap4r-straightjacket-1.5.9 test/16runner.rb
soap4r-straightjacket-1.5.8 test/16runner.rb
rubyjedi-soap4r-1.5.8.20100616125722 test/16runner.rb
rubyjedi-soap4r-1.5.8.01 test/16runner.rb