Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (45 sloc) 1.554 kb
092e008 @zenspider Added support for autotest.
zenspider authored
1 # -*- ruby -*-
2
3 Autotest.add_hook :run_command do |at|
4 system "rake"
5 end
6
7 class Autotest
8 alias :old_ruby :ruby
9 alias :old_make_test_cmd :make_test_cmd
10
11 def ruby
12 "USE_MSPEC=1 shotgun/rubinius"
13 end
14
15 def make_test_cmd files_to_test
16 cmds = []
17 full, partial = files_to_test.partition { |k,v| v.empty? }
18
19 unless full.empty? then
20 classes = full.map {|k,v| k}.flatten.uniq.sort.join(' ')
21
22 system "find spec -name \*excludes.txt | xargs cat > all-exclude.txt~"
23
24 cmds << "#{ruby} -I#{@libs} -e \"puts 'Started autotest'; %w[#{classes}].each { |f| require f }\" | #{unit_diff}"
25 end
26
27 partial.each do |klass, methods|
28 cmds << "#{ruby} -I#{@libs} #{klass} -n \"/^(#{Regexp.union(*methods).source})$/\" | #{unit_diff}"
29 end
30
31 return cmds.join("#{SEP} ")
32 end
33 end
34
35 Autotest.add_hook :initialize do |at|
36 at.exceptions << /\.rbc$/ << /\.txt$/
37
38 at.add_mapping %r%^spec/.*_spec\.rb$% do |filename, _|
39 filename
40 end
41
42 at.add_mapping %r%^kernel/(.*)/(.*).rb$% do |_, m|
43 Dir["spec/#{m[1]}/#{m[2]}/*_spec.rb"]
44 end
45
46 at.add_mapping %r%^kernel/(.*)/(.*).rb$% do |_, m|
47 Dir["spec/#{m[1]}/#{m[2]}/*_spec.rb"]
48 end
49
50 at.add_mapping %r%^compiler/(bytecode|sexp|translation)/*.rb$% do |_, m|
51 Dir["spec/compiler/rubinius/*_spec.rb"] + Dir["spec/language/*_spec.rb"]
52 end
53
54 at.add_mapping %r%^lib/(.*).rb% do |_, m|
55 Dir["spec/library/#{m[1]}*_spec.rb"]
56 end
57
58 at.add_mapping %r%^shotgun/lib/subtend/ruby.c$% do |_, m|
59 Dir["spec/rubinius|spec/rubinius/subtend/*_spec.rb"]
60 end
61 end
Something went wrong with that request. Please try again.