File: run-test.rb

package info (click to toggle)
ruby-activeldap 4.0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,524 kB
  • ctags: 1,815
  • sloc: ruby: 17,656; makefile: 15
file content (35 lines) | stat: -rwxr-xr-x 858 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env ruby

$VERBOSE = true

$KCODE = 'u' if RUBY_VERSION < "1.9"

base_dir = File.expand_path(File.dirname(__FILE__))
top_dir = File.expand_path(File.join(base_dir, ".."))
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 "test/unit"
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"
# target_adapters << "net-ldap"
# target_adapters << "jndi"
target_adapters.each do |adapter|
  ENV["ACTIVE_LDAP_TEST_ADAPTER"] = adapter
  puts "using adapter: #{adapter ? adapter : 'default'}"
  unless Test::Unit::AutoRunner.run(false, nil, ARGV.dup)
    succeeded = false
  end
  puts
end

exit(succeeded)