tapout 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby CHANGED
@@ -10,6 +10,7 @@ replacements: []
10
10
  conflicts: []
11
11
  requirements:
12
12
  - name: ansi
13
+ - name: json
13
14
  - name: detroit
14
15
  groups:
15
16
  - build
@@ -29,8 +30,8 @@ resources:
29
30
  load_path:
30
31
  - lib
31
32
  extra: {}
32
- date: '2011-10-06'
33
- version: 0.2.2
33
+ date: '2011-10-07'
34
+ version: 0.2.3
34
35
  alternatives: []
35
36
  revision: 0
36
37
  source:
@@ -1,5 +1,16 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+
4
+ == 0.2.3 / 2011-10-08
5
+
6
+ Exit code are important for a test output format. This release addressed that
7
+ issue.
8
+
9
+ Changes:
10
+
11
+ * Fixed exit code.
12
+
13
+
3
14
  == 0.2.2 / 2011-10-07
4
15
 
5
16
  Fixed incorrect tally entry in breakdown reporter.
data/PROFILE CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tapout
3
- version: 0.2.2
3
+ version: 0.2.3
4
4
 
5
5
  title: TapOut
6
6
  summary: Progressive TAP Harness
@@ -10,6 +10,7 @@ description:
10
10
 
11
11
  requires:
12
12
  - ansi
13
+ - json
13
14
  - detroit (build)
14
15
  - qed (test)
15
16
 
@@ -1,14 +1,11 @@
1
- = TapOut
1
+ = Tap Out
2
+
3
+ {Website}[http://rubyworks.github.com/tapout] |
4
+ {Development}[http://github.com/rubyworks/tapout]
2
5
 
3
6
  Copyright:: 2010 Thomas Sawyer, Rubyworks
4
- Author:: Thomas Sawyer
5
7
  License:: BSD-2-Clause
6
-
7
-
8
- == RESOURCES
9
-
10
- * home: http://rubyworks.github.com/tapout
11
- * work: http://github.com/rubyworks/tapout
8
+ Status:: {<img src="http://travis-ci.org/rubyworks/tapout.png" />}[http://travis-ci.org/rubyworks/tapout]
12
9
 
13
10
 
14
11
  == DESCRIPTION
@@ -33,26 +30,26 @@ the stream into `tapout`.
33
30
 
34
31
  $ ruby-test -y -Ilib test/foo.rb | tapout
35
32
 
36
- TapOut supports a variety of output formats. These are selectable via the `-f`
37
- option.
33
+ TapOut supports a variety of output formats. These are selectable via the
34
+ first argument. The default if not given, as in the example above, is `dotprogress`.
38
35
 
39
- $ ruby-test -y -Ilib test/foo.rb | tapout -f progessbar
36
+ $ ruby-test -y -Ilib test/foo.rb | tapout progessbar
40
37
 
41
38
  TapOut is smart enough to match the closest matching format name. So, for
42
39
  example, the above could be written as:
43
40
 
44
- $ ruby-test -y -Ilib test/foo.rb | tapout -f pro
41
+ $ ruby-test -y -Ilib test/foo.rb | tapout pro
45
42
 
46
43
  And tapout will know to use the `progressbar` format.
47
44
 
48
45
  To see a list of supported formats use the list subcommand:
49
46
 
50
- $ tapout list
47
+ $ tapout --help
51
48
 
52
49
  If your test framework does not support TAP-Y, but does support traditional
53
50
  TAP, TapOut will automatically recognize the difference by TAP's `1..N` header.
54
51
 
55
- $ ruby-test -ftap -Ilib test/foo.rb | tapout -f progressbar
52
+ $ ruby-test -ftap -Ilib test/foo.rb | tapout progressbar
56
53
 
57
54
 
58
55
  == COPYRIGHTS
data/TAP-YJ.md CHANGED
@@ -16,7 +16,7 @@ scalar, sequence and mapping.
16
16
 
17
17
  A YAML stream is composed a sequence of YAML *documents*, each divided by
18
18
  a start document marker (<code>---</code>). Each document MUST have a `type`
19
- field which designates it a `suite`, `case`, `unit`, `note` or `tally`. Any
19
+ field which designates it a `suite`, `case`, `test`, `note` or `tally`. Any
20
20
  document MAY have an `extra` entry which contains an open mapping for
21
21
  extraneous information.
22
22
 
@@ -25,7 +25,7 @@ module TapOut
25
25
  #end
26
26
 
27
27
  opt.on('--no-color', 'Supress ANSI color codes') do
28
- # TODO
28
+ $ansi = false # TODO: Is this correct?
29
29
  end
30
30
 
31
31
  opt.on('--debug', 'Run with $DEBUG flag on') do |fmt|
@@ -61,14 +61,16 @@ module TapOut
61
61
  case type
62
62
  when :perl
63
63
  stream_parser = PerlParser.new(options)
64
- stream_parser.consume(stdin)
64
+ exit_code = stream_parser.consume(stdin)
65
65
  when :yaml
66
66
  stream_parser = YamlParser.new(options)
67
- stream_parser.consume(stdin)
67
+ exit_code = stream_parser.consume(stdin)
68
68
  when :json
69
69
  stream_parser = JsonParser.new(options)
70
- stream_parser.consume(stdin)
70
+ exit_code = stream_parser.consume(stdin)
71
71
  end
72
+
73
+ exit(exit_code || 0)
72
74
  end
73
75
 
74
76
  #
@@ -19,6 +19,7 @@ module TapOut
19
19
  while line = input.gets
20
20
  self << line
21
21
  end
22
+ return @reporter.exit_code
22
23
  end
23
24
 
24
25
  #
@@ -18,6 +18,7 @@ module TapOut
18
18
  def consume(input)
19
19
  parser = PerlAdapter.new(input)
20
20
  parser | @reporter
21
+ return @reporter.exit_code
21
22
  end
22
23
 
23
24
  end
@@ -23,6 +23,7 @@ module TapOut
23
23
  self << line
24
24
  end
25
25
  handle unless @done # in case `...` was left out
26
+ return @reporter.exit_code
26
27
  end
27
28
 
28
29
  # TODO: write this as a YAML stream parser
@@ -36,8 +36,14 @@ module TapOut
36
36
  @skipped = []
37
37
  @omitted = []
38
38
 
39
- @source = {}
39
+ @source = {}
40
40
  @previous_case = nil
41
+ @exit_code = 0 # assume passing
42
+ end
43
+
44
+ # Exit code.
45
+ def exit_code
46
+ @exit_code
41
47
  end
42
48
 
43
49
  #
@@ -63,8 +69,10 @@ module TapOut
63
69
  when 'pass'
64
70
  pass(entry)
65
71
  when 'fail'
72
+ @exit_code = -1
66
73
  fail(entry)
67
74
  when 'error'
75
+ @exit_code = -1
68
76
  err(entry)
69
77
  when 'omit'
70
78
  omit(entry)
@@ -1,6 +1,6 @@
1
1
  module TapOut
2
2
  # Current version of TAPOUT project.
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
 
5
5
  # The current revision of the TAP-Y/J format.
6
6
  REVISION = "2"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-06 00:00:00.000000000 Z
12
+ date: 2011-10-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ansi
16
- requirement: &16900880 !ruby/object:Gem::Requirement
16
+ requirement: &29881940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,21 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *16900880
24
+ version_requirements: *29881940
25
+ - !ruby/object:Gem::Dependency
26
+ name: json
27
+ requirement: &29881400 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *29881400
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: detroit
27
- requirement: &16900340 !ruby/object:Gem::Requirement
38
+ requirement: &29880900 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ! '>='
@@ -32,10 +43,10 @@ dependencies:
32
43
  version: '0'
33
44
  type: :development
34
45
  prerelease: false
35
- version_requirements: *16900340
46
+ version_requirements: *29880900
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: qed
38
- requirement: &16899840 !ruby/object:Gem::Requirement
49
+ requirement: &29880400 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ! '>='
@@ -43,7 +54,7 @@ dependencies:
43
54
  version: '0'
44
55
  type: :development
45
56
  prerelease: false
46
- version_requirements: *16899840
57
+ version_requirements: *29880400
47
58
  description: Tapout is a TAP consumer that can take any TAP, TAP-Y or TAP-J stream
48
59
  and output it in a variety of useful formats.
49
60
  email:
@@ -78,7 +89,6 @@ files:
78
89
  - lib/tapout.rb
79
90
  - HISTORY.rdoc
80
91
  - PROFILE
81
- - TODO
82
92
  - LICENSE.txt
83
93
  - README.rdoc
84
94
  - COPYING.rdoc
data/TODO DELETED
@@ -1,5 +0,0 @@
1
- = TODO
2
-
3
- * Add version or revision field to suite entry.
4
-
5
-