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)
|
2013-10-11 17:35:01 -04:00
|
|
|
FileList.glob(pattern).each do |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
|
2013-10-11 17:35:01 -04:00
|
|
|
end
|
2007-12-20 22:22:43 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
extend self
|
|
|
|
end
|