forked from seattlerb/ruby_parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.autotest
78 lines (64 loc) · 2.2 KB
/
.autotest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# -*- 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 "unit"
at.add_exception "coverage"
at.add_exception "coverage.info"
at.add_exception ".diff"
at.add_exception ".output"
at.add_exception "lib/ruby18_parser.rb"
at.add_exception "lib/ruby19_parser.rb"
at.add_exception "lib/ruby20_parser.rb"
at.add_exception "lib/ruby21_parser.rb"
at.add_exception "lib/ruby22_parser.rb"
at.add_exception "lib/ruby20_parser.y"
at.add_exception "lib/ruby21_parser.y"
at.add_exception "lib/ruby22_parser.y"
at.add_exception "lib/ruby_lexer.rex.rb"
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(/1[89]|2[012]/, '')
at.files_matching %r%^test/.*#{g}.rb$%
end
at.add_mapping(/^lib\/.*\.yy$/) do |f, _|
g = File.basename(f, ".yy").gsub("_", "_?").gsub(/1[89]|2[012]/, '')
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).each do |klass|
at.extra_class_map[klass] = "test/test_ruby_parser_extras.rb"
end
%w(TestRuby18Parser TestRuby19Parser TestRuby20Parser TestRuby21Parser TestRuby22Parser TestRuby23Parser TestParseTree).each do |klass| # HACK
at.extra_class_map[klass] = "test/test_ruby_parser.rb"
end
end
Autotest.add_hook :run_command do |at, _|
system "rake parser lexer DEBUG=1"
end
class Autotest
def ruby
File.expand_path "~/.multiruby/install/1.9.3-p194/bin/ruby"
end
end if ENV["R19"]
class Autotest
def ruby
File.expand_path "~/.multiruby/install/2.0.0-p195/bin/ruby"
end
end if ENV["R20"]