runtest.rb 438 B

123456789101112131415161718192021
  1. require 'test/unit'
  2. require 'test/unit/assertions'
  3. module Rake
  4. include Test::Unit::Assertions
  5. def run_tests(pattern='test/test*.rb', log_enabled=false)
  6. Dir["#{pattern}"].each { |fn|
  7. $stderr.puts fn if log_enabled
  8. begin
  9. require fn
  10. rescue Exception => ex
  11. $stderr.puts "Error in #{fn}: #{ex.message}"
  12. $stderr.puts ex.backtrace
  13. assert false
  14. end
  15. }
  16. end
  17. extend self
  18. end