Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test: support running multi adapter tests
  • Loading branch information
kou committed Feb 4, 2014
1 parent 24efd9b commit a3fda07
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/run-test.rb
Expand Up @@ -6,9 +6,10 @@

base_dir = File.expand_path(File.dirname(__FILE__))
top_dir = File.expand_path(File.join(base_dir, ".."))
$LOAD_PATH.unshift(File.join(top_dir))
$LOAD_PATH.unshift(File.join(top_dir, "lib"))
$LOAD_PATH.unshift(File.join(top_dir, "test"))
lib_dir = File.join(top_dir, "lib")
test_dir = File.join(top_dir, "test")
$LOAD_PATH.unshift(lib_dir)
$LOAD_PATH.unshift(test_dir)

require "rubygems"
require "bundler/setup"
Expand All @@ -17,6 +18,10 @@
require "test/unit/notify"
Test::Unit::Priority.enable

Dir.glob(File.join(test_dir, "**", "test_*.rb")) do |test_file|
require test_file
end

succeeded = true
target_adapters = [ENV["ACTIVE_LDAP_TEST_ADAPTER"]]
# target_adapters << "ldap"
Expand All @@ -25,7 +30,7 @@
target_adapters.each do |adapter|
ENV["ACTIVE_LDAP_TEST_ADAPTER"] = adapter
puts "using adapter: #{adapter ? adapter : 'default'}"
unless Test::Unit::AutoRunner.run(true, File.dirname($0), ARGV.dup)
unless Test::Unit::AutoRunner.run(false, nil, ARGV.dup)
succeeded = false
end
puts
Expand Down

0 comments on commit a3fda07

Please sign in to comment.