mutant 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adcae01356f50d7189c8965ae495530cc0ad994e
4
- data.tar.gz: d6816c3ea9d5f2c47faa6fa6f6dbab79495ef327
3
+ metadata.gz: f3fbd46aa447dc402152bb4199a0ecfb1f1e9c8e
4
+ data.tar.gz: f01ecbd6a0dc0fac2c5676ab51d957b7a64744b8
5
5
  SHA512:
6
- metadata.gz: c67496fe405ff7ff754cc5614a67518de4b633e18b22072a99ab9812d76c63016cf97ca88f1faa0ac9478fe1cea9fca04e1eebdf21a135f1755cc302fc694035
7
- data.tar.gz: 1dbe0321e54c4bf8ccfaf531553133c966b6c22402e18b69cf064becd37c37023639a9e51253eccba71a5814d60f8883db16b4c3a0873ca8ab0536eba59fcfa5
6
+ metadata.gz: 04d88ed0b9914df3e8709711bd47a88390196a6316b385b07ea4a311b79b547936a5c3660b1ff85740fc8162dbe9c12ed463861695e9733ffcd87fe84eaebe56
7
+ data.tar.gz: 9702946488ff1c82f7a8ba2de538903acdc200ac161d33f016c37548d93594134243dd590c15f0647e5fed36b54b1cef7c3980a4af688b53e90801c9250ad5af
@@ -5,8 +5,7 @@ env:
5
5
  rvm:
6
6
  - 1.9.3
7
7
  - 2.0.0
8
- - 2.1.2
9
- - 2.1.3
8
+ - 2.1.4
10
9
  - rbx-2
11
10
  matrix:
12
11
  allow_failures:
@@ -1,8 +1,12 @@
1
- # v0.6.5 2014-10-29
1
+ # v0.6.6 2014-11-11
2
+
3
+ * Fix emitter to recurse into left and right of binary nodes.
4
+
5
+ # v0.6.5 2014-10-28
2
6
 
3
7
  * Fix killforks not to leak zombies.
4
8
 
5
- # v0.6.4 2014-10-28
9
+ # v0.6.4 2014-10-27
6
10
 
7
11
  * Do not buffer report prints, speedup large report generation.
8
12
  * Fix some cases where --fail-fast semantics stopped far to late.
data/README.md CHANGED
@@ -6,6 +6,7 @@ mutant
6
6
  [![Code Climate](https://codeclimate.com/github/mbj/mutant.png)](https://codeclimate.com/github/mbj/mutant)
7
7
  [![Inline docs](http://inch-ci.org/github/mbj/mutant.png)](http://inch-ci.org/github/mbj/mutant)
8
8
  [![Gem Version](https://img.shields.io/gem/v/mutant.svg)](https://rubygems.org/gems/mutant)
9
+ [![Flattr](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/thing/1823010/mbjmutant-on-GitHub)
9
10
 
10
11
  Mutant is a mutation testing tool for Ruby.
11
12
 
@@ -73,7 +74,7 @@ Install the gem `mutant` via your preferred method.
73
74
  gem install mutant
74
75
  ```
75
76
 
76
- If you plan to use the RSpec integration you'll have to install `mutant-rspec` also.
77
+ If you plan to use the RSpec integration you'll have to install `mutant-rspec` also.
77
78
  Please add an explicit dependency to `rspec-core` for the RSpec version you want to use.
78
79
 
79
80
  ```ruby
@@ -82,6 +83,31 @@ gem install mutant-rspec
82
83
 
83
84
  The minitest integration is still in the works.
84
85
 
86
+ The Crash / Stuck Problem (MRI)
87
+ -------------------------------
88
+
89
+ Mutations generated by mutant can cause MRI to enter VM states its not prepared for.
90
+ All MRI versions above 1.9 are affected by this depending on your compiler flags, compiler version,
91
+ and OS scheduling behavior.
92
+
93
+ This can have the following unintended effects:
94
+
95
+ * MRI crashes with a segfault. Mutant kills each mutation in a dedicated fork to isolate
96
+ the mutations side effects when this fork terminates abnormally (segfault) mutant
97
+ counts the mutation as killed.
98
+
99
+ * MRI crashes with a segfault and gets stuck when handling the segfault.
100
+ Depending on the number of active kill jobs mutant might appear to continue normally untill
101
+ all workers are stuck into this state when it begins to hang.
102
+ Currently mutant must assume that your test suite simply not terminated yet as from the outside
103
+ (parent process) the difference between a long running test and a stuck MRI is not observable.
104
+ Its planned to implement a timeout enforced from the parent process, but ideally MRI simply gets fixed.
105
+
106
+ References:
107
+
108
+ * Mutant bug: https://github.com/mbj/mutant/issues/265
109
+ * Upstream bug: https://bugs.ruby-lang.org/issues/10460
110
+
85
111
  Examples
86
112
  --------
87
113
 
data/Rakefile CHANGED
@@ -4,14 +4,15 @@ require 'devtools'
4
4
 
5
5
  Devtools.init_rake_tasks
6
6
 
7
- # Mutant self test is to slow for travis. Fast enough for circle.
8
- if ENV['TRAVIS']
7
+ # Frequent lookups in MRI make mutation analysis getting stuck on CI
8
+ # See: https://github.com/mbj/mutant/issues/265
9
+ if ENV['CI']
9
10
  Rake.application.load_imports
10
11
 
11
12
  task('metrics:mutant').clear
12
13
  namespace :metrics do
13
14
  task :mutant => :coverage do
14
- $stderr.puts 'Mutant self test via zombie not active on travis CI'
15
+ $stderr.puts 'Mutant self test via zombie not active on CI'
15
16
  end
16
17
  end
17
18
  end
data/circle.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  machine:
3
3
  ruby:
4
- version: 2.1.2
4
+ version: 2.1.4
5
5
  test:
6
6
  override:
7
7
  - bundle exec rake ci
@@ -41,8 +41,11 @@ module Mutant
41
41
  # Nodes that are NOT generated by parser but used by mutant / unparser.
42
42
  EXTRA = symbolset.(%w[empty])
43
43
 
44
+ # Nodes that are currently missing from parser META
45
+ MISSING = symbolset.(%w[rational])
46
+
44
47
  # All node types mutant handles
45
- ALL = symbolset.((Parser::Meta::NODE_TYPES + EXTRA) - BLACKLIST)
48
+ ALL = symbolset.((Parser::Meta::NODE_TYPES + EXTRA + MISSING) - BLACKLIST)
46
49
  end # Types
47
50
  end # AST
48
51
  end # Mutant
@@ -27,6 +27,8 @@ module Mutant
27
27
  emit(right)
28
28
  mutate_operator
29
29
  mutate_operands
30
+ emit_left_mutations
31
+ emit_right_mutations
30
32
  end
31
33
 
32
34
  # Emit operator mutations
@@ -13,7 +13,7 @@ module Mutant
13
13
  :alias, :for, :xstr, :back_ref, :class,
14
14
  :sclass, :match_with_lvasgn, :while_post,
15
15
  :until_post, :preexe, :postexe, :iflipflop, :eflipflop, :kwsplat,
16
- :shadowarg
16
+ :shadowarg, :rational, :complex, :__FILE__, :__LINE__
17
17
  )
18
18
 
19
19
  private
@@ -56,6 +56,8 @@ module Mutant
56
56
 
57
57
  # Assert the node type is valid
58
58
  #
59
+ # @param [Symbol] type
60
+ #
59
61
  # @return [undefined]
60
62
  #
61
63
  # @raise [InvalidTypeError]
@@ -1,4 +1,4 @@
1
1
  module Mutant
2
2
  # The current mutant version
3
- VERSION = '0.6.5'.freeze
3
+ VERSION = '0.6.6'.freeze
4
4
  end # Mutant
@@ -7,6 +7,10 @@ Mutant::Meta::Example.add do
7
7
  mutation 'true'
8
8
  mutation 'false'
9
9
  mutation 'true or false'
10
+ mutation 'true and nil'
11
+ mutation 'nil and false'
12
+ mutation 'false and false'
13
+ mutation 'true and true'
10
14
  mutation '!true and false'
11
15
  mutation '!(true and false)'
12
16
  end
@@ -20,6 +20,6 @@ Mutant::Meta::Example.add do
20
20
 
21
21
  source s(:begin, s(:true))
22
22
  # Mutation of each statement in block
23
- mutation s(:begin, s(:false))
24
23
  mutation s(:begin, s(:nil))
24
+ mutation s(:begin, s(:false))
25
25
  end
@@ -4,10 +4,11 @@ Mutant::Meta::Example.add do
4
4
  source ':"foo#{bar}baz"'
5
5
 
6
6
  singleton_mutations
7
- mutation ':"#{nil}#{bar}baz"'
8
- mutation ':"#{self}#{bar}baz"'
9
- mutation ':"foo#{bar}#{nil}"'
10
- mutation ':"foo#{bar}#{self}"'
11
- mutation ':"foo#{nil}baz"'
12
- mutation ':"foo#{self}baz"'
7
+ # TODO: Unparser imperfection two asts with same source.
8
+ mutation s(:dsym, s(:nil), s(:begin, s(:send, nil, :bar)), s(:str, 'baz'))
9
+ mutation s(:dsym, s(:self), s(:begin, s(:send, nil, :bar)), s(:str, 'baz'))
10
+ mutation s(:dsym, s(:str, 'foo'), s(:begin, s(:self)), s(:str, 'baz'))
11
+ mutation s(:dsym, s(:str, 'foo'), s(:begin, s(:nil)), s(:str, 'baz'))
12
+ mutation s(:dsym, s(:str, 'foo'), s(:begin, s(:send, nil, :bar)), s(:nil))
13
+ mutation s(:dsym, s(:str, 'foo'), s(:begin, s(:send, nil, :bar)), s(:self))
13
14
  end
data/meta/or.rb CHANGED
@@ -6,6 +6,10 @@ Mutant::Meta::Example.add do
6
6
  singleton_mutations
7
7
  mutation 'true'
8
8
  mutation 'false'
9
+ mutation 'nil or false'
10
+ mutation 'false or false'
11
+ mutation 'true or nil'
12
+ mutation 'true or true'
9
13
  mutation 'true and false'
10
14
  mutation '!true or false'
11
15
  mutation '!(true or false)'
@@ -23,14 +23,14 @@ Gem::Specification.new do |gem|
23
23
 
24
24
  gem.required_ruby_version = '>= 1.9.3'
25
25
 
26
- gem.add_runtime_dependency('parser', '~> 2.1')
26
+ gem.add_runtime_dependency('parser', '~> 2.2.pre.7')
27
27
  gem.add_runtime_dependency('ast', '~> 2.0')
28
28
  gem.add_runtime_dependency('diff-lcs', '~> 1.2')
29
29
  gem.add_runtime_dependency('parallel', '~> 1.3')
30
30
  gem.add_runtime_dependency('morpher', '~> 0.2.3')
31
31
  gem.add_runtime_dependency('procto', '~> 0.0.2')
32
32
  gem.add_runtime_dependency('abstract_type', '~> 0.0.7')
33
- gem.add_runtime_dependency('unparser', '~> 0.1.15')
33
+ gem.add_runtime_dependency('unparser', '~> 0.1.16')
34
34
  gem.add_runtime_dependency('ice_nine', '~> 0.11.0')
35
35
  gem.add_runtime_dependency('adamantium', '~> 0.2.0')
36
36
  gem.add_runtime_dependency('memoizable', '~> 0.4.2')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-28 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.1'
19
+ version: 2.2.pre.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.1'
26
+ version: 2.2.pre.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ast
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.1.15
117
+ version: 0.1.16
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.1.15
124
+ version: 0.1.16
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: ice_nine
127
127
  requirement: !ruby/object:Gem::Requirement