autotest 4.1.4 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,27 @@
1
+ === 4.2.1 / 2009-12-09
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added GEM_HOME/GEM_PATH setting to multiruby.
6
+
7
+ * 1 bug fix:
8
+
9
+ * Fixed multiruby refactoring bug from previous release.
10
+
11
+ === 4.2.0 / 2009-12-08
12
+
13
+ * 3 minor enhancements:
14
+
15
+ * Added 'multiruby -1 $version' for easier execution (idea from flori)
16
+ * Set up and tear down PATH in multiruby (luis)
17
+ * died hook now gets passed the exception (amikula)
18
+
19
+ * 3 bug fixes:
20
+
21
+ * Deal with windoze getc returning nil (undees)
22
+ * Fix unit_diff for multiline miniunit results.
23
+ * Fix warning for 1.8.8+
24
+
1
25
  === 4.1.4 / 2009-08-07
2
26
 
3
27
  * 2 minor enhancements:
@@ -1,13 +1,13 @@
1
- Autotest is a continous testing facility meant to be used during
2
- development.
3
- As soon as you save a file, autotest will run the corresponding dependent tests.
1
+ As soon as you save a file, autotest will run the matching tests.
4
2
 
5
- Requirements
6
- ============
7
- * Ruby 1.6+, JRuby 1.1.2+, or rubinius
8
- * Test::Unit or miniunit
9
- * rubygems
10
- * diff.exe on windoze. Try http://gnuwin32.sourceforge.net/packages.html
3
+ This is a fork of the ZenTest package to extract autotest from it.
4
+
5
+ Improvements over ZenTest
6
+ =========================
7
+ - possibility to not run all tests after a failed test passes
8
+ - simplified test setup
9
+ - simplified packaging
10
+ - less globals flying around
11
11
 
12
12
  Install
13
13
  =======
@@ -16,17 +16,24 @@ Uninstall ZenTest first, or autotest will not be found:
16
16
  Install:
17
17
  sudo gem install autotest
18
18
  To install an [AutoTest free ZenTest](http://github.com/grosser/zentest) version:
19
- sudo gem install grosser-zentest -s http://gems.github.com
19
+ sudo gem install zentest-without-autotest
20
20
 
21
- Setup
21
+ Usage
22
22
  =====
23
- ###Options
24
- -f, --fast-start Do not run full tests at start
25
- -c, --no-full-after-failed Do not run full tests after failed test passed
23
+ - go to a project folder with tests/specs/...
24
+ - run autotest
25
+
26
+ ### Options
27
+ -f, --fast-start Do not run all tests at start
28
+ -c, --no-full-after-failed Do not run all tests after failed test passes
26
29
  -v, --verbose Be verbose. Prints files that autotest doesn't know how to map to tests
27
30
  -q, --quiet Be quiet.
28
31
  -h, --help Show this.
29
32
 
33
+ Tips
34
+ ====
35
+ - you need diff.exe on windows. Try http://gnuwin32.sourceforge.net/packages.html
36
+
30
37
  TODO
31
38
  ====
32
39
  - add documentation for hooks / flags
@@ -40,7 +47,7 @@ TODO
40
47
  License
41
48
  =======
42
49
 
43
- ###This is only stripped down version of ZenTest
50
+ ###This is a stripped down version of ZenTest
44
51
  Stripper: [Michael Grosser](http://pragmatig.wordpress.com)
45
52
 
46
53
  ### ZenTest Authors
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.4
1
+ 4.2.1
@@ -474,7 +474,7 @@ suite for any change by adding the following code to your
474
474
  #
475
475
  class Autotest
476
476
 
477
- def tests_files_for(filename)
477
+ def test_files_for(filename)
478
478
  return Dir["test/**/*.rb"]
479
479
  end
480
480
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{autotest}
8
- s.version = "4.1.4"
8
+ s.version = "4.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ryan Davis"]
12
- s.date = %q{2009-12-19}
12
+ s.date = %q{2010-01-18}
13
13
  s.executables = ["unit_diff", "autotest"]
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown"
@@ -17,9 +17,8 @@ require 'unit_diff'
17
17
 
18
18
  ############################################################
19
19
 
20
- #TODO fix this...
21
20
  if defined? $v then
22
- puts "#{File.basename $0} v. 4.0.3"
21
+ puts "#{File.basename $0} v. #{File.read( File.join(File.dirname(__FILE__),'..','VERSION') )}"
23
22
  exit 0
24
23
  end
25
24
 
@@ -168,7 +168,7 @@ class Autotest
168
168
  self.order = :random
169
169
  self.output = $stderr
170
170
  self.sleep = 1
171
- self.testlib = "test/unit"
171
+ self.testlib = "test/unit"
172
172
  self.find_directories = ['.']
173
173
  self.unit_diff = "unit_diff -u"
174
174
 
@@ -216,8 +216,8 @@ class Autotest
216
216
  end
217
217
  end
218
218
  hook :quit
219
- rescue Exception
220
- hook :died
219
+ rescue Exception => err
220
+ hook :died, err
221
221
  end
222
222
 
223
223
  ##
@@ -252,8 +252,8 @@ class Autotest
252
252
  begin
253
253
  open("| #{cmd}", "r") do |f|
254
254
  until f.eof? do
255
- c = f.getc
256
- putc c
255
+ c = f.getc or break
256
+ print c
257
257
  line << c
258
258
  if c == ?\n then
259
259
  self.results << if RUBY_VERSION >= "1.9" then
@@ -81,7 +81,7 @@ class UnitDiff
81
81
  end
82
82
  output.puts input.gets # the rest of "Finished in..."
83
83
  output.puts
84
- next
84
+ next
85
85
  when /^\s*$/, /^\(?\s*\d+\) (Failure|Error):/, /^\d+\)/ then
86
86
  print_lines = false
87
87
  current = []
@@ -96,6 +96,22 @@ class UnitDiff
96
96
  data = data.reject { |o| o == ["\n"] or o.empty? }
97
97
  footer = data.pop
98
98
 
99
+ data.map do |result|
100
+ break if result.find do |line|
101
+ line =~ / expected( but was|, not)/
102
+ end
103
+
104
+ header = result.find do |line|
105
+ line =~ /^\(?\s*\d+\) (Failure|Error):/
106
+ end
107
+
108
+ break unless header
109
+
110
+ message_index = result.index(header) + 2
111
+
112
+ result[message_index..-1] = result[message_index..-1].join
113
+ end
114
+
99
115
  return data, footer
100
116
  end
101
117
 
@@ -36,6 +36,27 @@ Expected ['a', 'b', 'c'], not ['a', 'c', 'b'].
36
36
  util_unit_diff(header, input, expected, :parse_input)
37
37
  end
38
38
 
39
+ def test_input_miniunit_multiline
40
+ header = "Loaded suite -e\nStarted\nF\nFinished in 0.035332 seconds.\n\n"
41
+ input = "#{header} 1) Failure:
42
+ test_blah(TestBlah) [./blah.rb:25]:
43
+ Expected ['a',
44
+ 'b',
45
+ 'c'], not ['a',
46
+ 'c',
47
+ 'b'].
48
+
49
+ 1 tests, 1 assertions, 1 failures, 0 errors
50
+ "
51
+
52
+ expected = [[[" 1) Failure:\n",
53
+ "test_blah(TestBlah) [./blah.rb:25]:\n",
54
+ "Expected ['a',\n 'b',\n 'c'], not ['a',\n 'c',\n 'b'].\n"]],
55
+ ["\n", "1 tests, 1 assertions, 1 failures, 0 errors\n"]]
56
+
57
+ util_unit_diff(header, input, expected, :parse_input)
58
+ end
59
+
39
60
  def test_input_mspec
40
61
  header = <<-HEADER
41
62
  Started
@@ -161,6 +182,7 @@ backtrace = <<-BACKTRACE
161
182
 
162
183
  assert_equal expected, @diff.parse_diff(input)
163
184
  end
185
+
164
186
  def test_parse_diff1
165
187
  input = [" 1) Failure:\n",
166
188
  "test_test1(TestBlah) [./blah.rb:25]:\n",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autotest
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.4
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-19 00:00:00 +01:00
12
+ date: 2010-01-18 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15