Sha256: 9b45cfdf1ea587f6c6c6fcfe1a81ea9aab0a25348c3a34f386c6d8c3c1e584ee

Contents?: true

Size: 1.72 KB

Versions: 18

Compression:

Stored size: 1.72 KB

Contents

# -*- ruby -*-

require 'autotest/restart'
# require 'autotest/isolate'
require 'autotest/rcov' if ENV['RCOV']

Autotest.add_hook :initialize do |at|
  at.extra_files << "../../sexp_processor/dev/lib/pt_testcase.rb"
  at.libs << ":../../sexp_processor/dev/lib"
  at.add_exception ".diff"
  at.add_exception ".rdoc"
  at.add_exception ".yml"
  at.add_exception ".txt"
  at.add_exception ".output"
  at.add_exception "bin"
  at.add_exception "compare"
  at.add_exception "coverage"
  at.add_exception "coverage.info"
  at.add_exception "misc"

  Dir["lib/ruby??_parser.{rb,y}"].each do |f|
    at.add_exception f
  end

  Dir["gauntlet*"].each do |f|
    at.add_exception f
  end

  at.libs << ':../../minitest/dev/lib'
  at.testlib = "minitest/autorun"

  at.add_mapping(/^lib\/.*\.y$/) do |f, _|
    g = File.basename(f, ".y").gsub("_", "_?").gsub(/2\d/, '')
    at.files_matching %r%^test/.*#{g}.rb$%
  end

  at.add_mapping(/^lib\/.*\.yy$/) do |f, _|
    g = File.basename(f, ".yy").gsub("_", "_?")
    at.files_matching %r%^test/.*#{g}.rb$%
  end

  at.add_mapping(/^lib\/ruby_lexer\.rex\.rb$/) do |f, _|
    at.files_matching %r%^test/.*ruby_lexer\.rb$%
  end

  at.add_mapping(/^lib\/.*\.rex$/) do |f, _|
    g = File.basename(f, ".rex").gsub("_", "_?")
    at.files_matching %r%^test/.*#{g}.rb$%
  end

  at.add_mapping(/pt_testcase.rb/) do |f, _|
    at.files_matching(/test_.*rb$/)
  end

  %w(TestEnvironment TestStackState TestValueExpr).each do |klass|
    at.extra_class_map[klass] = "test/test_ruby_parser_extras.rb"
  end

  Dir["lib/ruby??_parser.rb"].each do |s|
    n = s[/\d+/]
    at.extra_class_map["TestRubyParserV#{n}"] = "test/test_ruby_parser.rb"
  end
end

Autotest.add_hook :run_command do |at, _|
  system "rake parser lexer DEBUG=1"
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ruby_parser-3.21.1 .autotest
ruby_parser-3.21.0 .autotest
ruby_parser-3.20.3 .autotest
ruby_parser-3.20.2 .autotest
ruby_parser-3.20.1 .autotest
ruby_parser-3.20.0 .autotest
ruby_parser-3.19.2 .autotest
ruby_parser-3.19.1 .autotest
ruby_parser-3.19.0 .autotest
ruby_parser-3.18.1 .autotest
ruby_parser-3.18.0 .autotest
ruby_parser-3.17.0 .autotest
ruby_parser-3.16.0 .autotest
ruby_parser-3.15.1 .autotest
ruby_parser-3.15.0 .autotest
ruby_parser-3.14.2 .autotest
ruby_parser-3.14.1 .autotest
ruby_parser-3.14.0 .autotest