autotest 4.2.6 → 4.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/autotest.gemspec +1 -1
- data/bin/autotest +2 -2
- data/lib/autotest.rb +1 -3
- data/test/test_autotest.rb +4 -2
- data/test/test_autotest_integration.rb +1 -6
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.2.
|
1
|
+
4.2.7
|
data/autotest.gemspec
CHANGED
data/bin/autotest
CHANGED
@@ -45,8 +45,8 @@ unless style.empty? then
|
|
45
45
|
puts "loading #{mod}" unless options[:quiet]
|
46
46
|
begin
|
47
47
|
require mod
|
48
|
-
rescue LoadError
|
49
|
-
abort "Autotest style #{mod}
|
48
|
+
rescue LoadError => e
|
49
|
+
abort "Error loading Autotest style #{mod} (#{e.to_s}). Aborting."
|
50
50
|
end
|
51
51
|
puts "style: #{style.map {|s| s.capitalize}.join}"
|
52
52
|
target = Autotest.const_get(style.map {|s| s.capitalize}.join)
|
data/lib/autotest.rb
CHANGED
@@ -157,8 +157,6 @@ class Autotest
|
|
157
157
|
@exception_list = []
|
158
158
|
@test_mappings = []
|
159
159
|
|
160
|
-
ENV['UNIT_DIFF'] ||= File.expand_path("#{File.dirname(__FILE__)}/../bin/unit_diff")
|
161
|
-
|
162
160
|
self.completed_re = /\d+ tests, \d+ assertions, \d+ failures, \d+ errors/
|
163
161
|
self.extra_class_map = {}
|
164
162
|
self.extra_files = []
|
@@ -172,7 +170,7 @@ class Autotest
|
|
172
170
|
self.sleep = 1
|
173
171
|
self.testlib = "test/unit"
|
174
172
|
self.find_directories = ['.']
|
175
|
-
self.unit_diff = "#{
|
173
|
+
self.unit_diff = "#{File.expand_path("#{File.dirname(__FILE__)}/../bin/unit_diff")} -u"
|
176
174
|
|
177
175
|
#add Test::Unit mappings
|
178
176
|
#file in /lib -> run test in /test
|
data/test/test_autotest.rb
CHANGED
@@ -362,8 +362,10 @@ test_error2(#{@test_class}):
|
|
362
362
|
'test/test_fooby.rb' => [ 'test_something1', 'test_something2' ]
|
363
363
|
}
|
364
364
|
|
365
|
-
|
366
|
-
|
365
|
+
unit_diff = File.expand_path("#{File.dirname(__FILE__)}/../bin/unit_diff")
|
366
|
+
|
367
|
+
expected = [ "#{RUBY} -I.:lib:test -rubygems -e \"%w[test/unit #{@test}].each { |f| require f }\" | #{unit_diff} -u",
|
368
|
+
"#{RUBY} -I.:lib:test -rubygems test/test_fooby.rb -n \"/^(test_something1|test_something2)$/\" | #{unit_diff} -u" ].join("; ")
|
367
369
|
|
368
370
|
result = @a.make_test_cmd f
|
369
371
|
assert_equal expected, result
|
@@ -11,12 +11,8 @@ class TestAutotestIntegration < Test::Unit::TestCase
|
|
11
11
|
'../../bin/autotest'
|
12
12
|
end
|
13
13
|
|
14
|
-
def unit_diff_executable
|
15
|
-
File.expand_path("./#{File.dirname(__FILE__)}/../bin/unit_diff")
|
16
|
-
end
|
17
|
-
|
18
14
|
def run_autotest(flag_string='')
|
19
|
-
|
15
|
+
`cd #{temp_dir} && #{autotest_executable} #{flag_string}`
|
20
16
|
end
|
21
17
|
|
22
18
|
def write(file, text)
|
@@ -33,7 +29,6 @@ class TestAutotestIntegration < Test::Unit::TestCase
|
|
33
29
|
context 'integration' do
|
34
30
|
context 'green run' do
|
35
31
|
setup do
|
36
|
-
ENV['UNIT_DIFF'] = unit_diff_executable
|
37
32
|
`rm -rf #{temp_dir}`
|
38
33
|
`mkdir #{temp_dir}`
|
39
34
|
write('.autotest', "Autotest.add_hook(:all_good){print 'all_good';exit}")
|