2007-12-20 22:22:43 -05:00
|
|
|
require 'test/unit'
|
|
|
|
require 'test/unit/assertions'
|
2012-11-15 17:32:34 -05:00
|
|
|
require 'rake/file_list'
|
2007-12-20 22:22:43 -05:00
|
|
|
|
|
|
|
module Rake
|
|
|
|
include Test::Unit::Assertions
|
|
|
|
|
|
|
|
def run_tests(pattern='test/test*.rb', log_enabled=false)
|
2012-11-15 17:32:34 -05:00
|
|
|
FileList.glob(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
|