mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
modified some tests, added a test runner
This commit is contained in:
parent
fef6d10342
commit
cc1c1e23be
6 changed files with 295 additions and 241 deletions
30
test/runner.rb
Executable file
30
test/runner.rb
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env ruby
|
||||
# -*- mode: ruby; coding: utf-8-unix -*-
|
||||
require 'test/unit'
|
||||
|
||||
if Test::Unit.methods.include? :setup_argv
|
||||
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
|
||||
}
|
||||
elsif Test::Unit.constants.include? 'AutoRunner'
|
||||
Test::Unit::AutoRunner.run(true, './')
|
||||
else
|
||||
raise Error, 'Test runner not found'
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue