summaryrefslogtreecommitdiffstats
path: root/test/runner.rb
blob: 3f1c8abc191191da98b6e66fd2f2d465b97cb5d9 (plain)
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
require 'rbconfig'
exit if CROSS_COMPILING

require 'test/unit'

src_testdir = File.dirname(File.expand_path(__FILE__))
srcdir = File.dirname(src_testdir)

Test::Unit.setup_argv {|files|
  if files.empty?
    [src_testdir]
  else
    files.map {|f|
      if File.exist? "#{src_testdir}/#{f}"
        "#{src_testdir}/#{f}"
      elsif File.exist? "#{srcdir}/#{f}"
        "#{srcdir}/#{f}"
      elsif File.exist? f
        f
      else
        raise ArgumentError, "not found: #{f}"
      end
    }
  end
}