Codebase list ruby-glut / 333eb1d2-981c-4a2e-b5e9-3121cd40a6f5/main .autotest
333eb1d2-981c-4a2e-b5e9-3121cd40a6f5/main

Tree @333eb1d2-981c-4a2e-b5e9-3121cd40a6f5/main (Download .tar.gz)

.autotest @333eb1d2-981c-4a2e-b5e9-3121cd40a6f5/mainraw · history · blame

require 'autotest/restart'

Autotest.add_hook :initialize do |at|
  at.add_exception /\.git/
  at.add_exception /doc/
  at.add_exception /examples/
  at.add_exception /utils/
  at.add_exception /website/

  at.add_mapping(/^lib\/.*(\.bundle|so|dll)$/) do |filename, match|
    possible = File.basename(filename, match[1])
    at.files_matching %r%^test/test_#{possible}%
  end

  def at.path_to_classname s
    sep = File::SEPARATOR
    n = s.sub(/^test#{sep}test_(.*)\.rb/, '\1')
    c = if n =~ /^(glu?)_?(.*)/ then
          "#{$1.capitalize}#{$2.split(/_|(\d+)/).map { |seg| seg.capitalize }.join}"
        end

    "Test#{c}"
  end
end

Autotest.add_hook :run_command do |at|
  at.unit_diff = 'cat'
  system Gem.ruby, Gem.bin_path('rake', 'rake'), 'compile'
end