Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 107 lines (84 sloc) 2.85 kb
092e008 @zenspider Added support for autotest.
zenspider authored
1 # -*- ruby -*-
2
869f0aa More .autotest love - now bad-ass
Ryan Davis authored
3 $q = true && ! $v
76b3935 @zenspider Fixed autotest support (needs latest version of zentest).
zenspider authored
4
092e008 @zenspider Added support for autotest.
zenspider authored
5 Autotest.add_hook :run_command do |at|
6 system "rake"
7 end
8
9 class Autotest
10 alias :old_ruby :ruby
869f0aa More .autotest love - now bad-ass
Ryan Davis authored
11 alias :old_consolidate_failures :consolidate_failures
092e008 @zenspider Added support for autotest.
zenspider authored
12 alias :old_make_test_cmd :make_test_cmd
13
14 def ruby
3904ff2 @brixen Fixes for mSpec to coexist with autotest.
brixen authored
15 "bin/ci -fu"
092e008 @zenspider Added support for autotest.
zenspider authored
16 end
17
869f0aa More .autotest love - now bad-ass
Ryan Davis authored
18 def consolidate_failures(failed)
19 filters = new_hash_of_arrays
20
21 failed.each do |spec, failed_trace|
22 failed_trace.scan(/ at ([^:]+)/).each do |file,|
23 file.sub!(/^\.\//, '')
24 next unless file =~ /^spec/
25 test_files_for(file).each do |f|
26 p :test_file => f
27 filters[f] # mspec doesn't have real spec filtering yet
28 end
29 break
30 end
31 end
32
33 return filters
34 end
35
092e008 @zenspider Added support for autotest.
zenspider authored
36 def make_test_cmd files_to_test
76b3935 @zenspider Fixed autotest support (needs latest version of zentest).
zenspider authored
37 # until bin/ci and bin/mspec allow for regexps, run the whole file again
38 classes = reorder(files_to_test).map { |k,v| k }.join(' ')
dfb772f @zenspider Activate pp only if $PRETTY set.
zenspider authored
39 "PRETTY=1 #{ruby} #{classes} | #{unit_diff}"
092e008 @zenspider Added support for autotest.
zenspider authored
40 end
41 end
42
43 Autotest.add_hook :initialize do |at|
76b3935 @zenspider Fixed autotest support (needs latest version of zentest).
zenspider authored
44 at.order = :natural
45
4d5a52d @zenspider Added extra exceptions and removed all-exclude.txt~ generator since that...
zenspider authored
46 at.add_exception(/\.rbc$/)
47 at.add_exception(/fixtures/)
869f0aa More .autotest love - now bad-ass
Ryan Davis authored
48 at.add_exception(/shotgun\/external_libs/)
45f2d6d @zenspider Added more brains to .autotest. Removed bad files that it pointed out
zenspider authored
49 at.add_exception(/README/)
50 at.add_exception(/spec.data.critical.txt/)
76b3935 @zenspider Fixed autotest support (needs latest version of zentest).
zenspider authored
51
869f0aa More .autotest love - now bad-ass
Ryan Davis authored
52 at.find_directories.clear
53 at.find_directories.push(
54 'kernel',
55 # 'lib', # TODO: port mri tests to specs?
56 'shotgun',
57 'spec/ruby/1.8/core',
76b3935 @zenspider Fixed autotest support (needs latest version of zentest).
zenspider authored
58 'spec/ruby/1.8/language',
59 'spec/compiler',
869f0aa More .autotest love - now bad-ass
Ryan Davis authored
60 'spec/parser',
61 'spec/data'
62 )
63
64 at.failed_results_re = /^\d+\)\n([^\n]*)(?:FAILED|ERROR)?\n(.*?)\n\n/m
65 at.completed_re = /\Z/ # FIX: some sort of summary line at the end?
092e008 @zenspider Added support for autotest.
zenspider authored
66
45f2d6d @zenspider Added more brains to .autotest. Removed bad files that it pointed out
zenspider authored
67 at.add_mapping %r%^spec/data/(.*)_excludes.txt$% do |_, m|
68 Dir["spec/#{m[1]}_spec.rb"]
69 end
70
71 at.add_mapping %r%^spec/(.*)/shared/% do |_, m|
72 at.files_matching(%r%^spec/#{m[1]}/.*_spec.rb$%)
73 end
74
75 at.add_mapping %r%^spec/spec_helper.rb% do
76 at.files_matching(%r%^spec/.*_spec.rb$%)
77 end
78
79 at.add_mapping %r%^spec/compiler/spec_helper.rb% do
80 at.files_matching(%r%^spec/compiler/.*_spec.rb$%)
81 end
82
83 at.add_mapping %r%^spec/parser/sexp_expectations.rb% do
84 at.files_matching(%r%^spec/parser/.*_spec.rb$%)
85 end
86
092e008 @zenspider Added support for autotest.
zenspider authored
87 at.add_mapping %r%^spec/.*_spec\.rb$% do |filename, _|
88 filename
89 end
90
91 at.add_mapping %r%^kernel/(.*)/(.*).rb$% do |_, m|
92 Dir["spec/#{m[1]}/#{m[2]}/*_spec.rb"]
93 end
94
95 at.add_mapping %r%^compiler/(bytecode|sexp|translation)/*.rb$% do |_, m|
96 Dir["spec/compiler/rubinius/*_spec.rb"] + Dir["spec/language/*_spec.rb"]
97 end
98
99 at.add_mapping %r%^lib/(.*).rb% do |_, m|
100 Dir["spec/library/#{m[1]}*_spec.rb"]
101 end
102
869f0aa More .autotest love - now bad-ass
Ryan Davis authored
103 at.add_mapping %r%^shotgun% do |_, m|
104 at.files_matching(/^spec.*_spec\.rb/)
092e008 @zenspider Added support for autotest.
zenspider authored
105 end
106 end
Something went wrong with that request. Please try again.