2007-12-20 22:22:43 -05:00
|
|
|
require 'test/unit'
|
|
|
|
require 'test/unit/assertions'
|
|
|
|
|
|
|
|
module Rake
|
|
|
|
include Test::Unit::Assertions
|
|
|
|
|
|
|
|
def run_tests(pattern='test/test*.rb', log_enabled=false)
|
|
|
|
Dir["#{pattern}"].each { |fn|
|
2011-06-23 18:11:55 -04:00
|
|
|
$stderr.puts fn if log_enabled
|
2007-12-20 22:22:43 -05:00
|
|
|
begin
|
2011-06-23 18:11:55 -04:00
|
|
|
require fn
|
2007-12-20 22:22:43 -05:00
|
|
|
rescue Exception => ex
|
2011-06-23 18:11:55 -04:00
|
|
|
$stderr.puts "Error in #{fn}: #{ex.message}"
|
|
|
|
$stderr.puts ex.backtrace
|
2007-12-20 22:22:43 -05:00
|
|
|
assert false
|
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
extend self
|
|
|
|
end
|