mutant 0.10.33 → 0.10.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mutant/cli/command/environment/run.rb +24 -1
- data/lib/mutant/cli/command.rb +2 -0
- data/lib/mutant/mutator/node/binary.rb +5 -6
- data/lib/mutant/mutator/node/numblock.rb +21 -0
- data/lib/mutant/reporter/cli/printer/mutation.rb +1 -1
- data/lib/mutant/reporter/cli/printer/mutation_result.rb +1 -1
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccd2a5c4c1c3ddf3b7eea82c613a144594609387a414cac729b75c4645295f47
|
4
|
+
data.tar.gz: e173ad25eb08658a040a7ca7cb6dca36a1d8bc9f01137e63fed081069b3ab9cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdebc9987d92b122b409715cc7933dc86952ae6dc58ed8f9a5525bcbfe8dc0aae93cf773622eced59643d27d4311df1f94f9c41a1abd1adc93e4a6b65771118d
|
7
|
+
data.tar.gz: 9e7d2dde25b8e532301475e8b7bc970626db00d36ce0abd5e4082aa2b39599a86372b4de93e5d61470f974f90539cf5445d51e242bcfbfec600ad8a5fca2b5aa
|
@@ -7,7 +7,7 @@ module Mutant
|
|
7
7
|
class Run < self
|
8
8
|
NAME = 'run'
|
9
9
|
SHORT_DESCRIPTION = 'Run code analysis'
|
10
|
-
SLEEP =
|
10
|
+
SLEEP = 60
|
11
11
|
SUBCOMMANDS = EMPTY_ARRAY
|
12
12
|
|
13
13
|
UNLICENSED = <<~MESSAGE.lines.freeze
|
@@ -16,6 +16,20 @@ module Mutant
|
|
16
16
|
See https://github.com/mbj/mutant#licensing
|
17
17
|
MESSAGE
|
18
18
|
|
19
|
+
NO_TESTS_MESSAGE = <<~'MESSAGE'
|
20
|
+
===============
|
21
|
+
Mutant found no tests. Mutation testing cannot be started.
|
22
|
+
|
23
|
+
This can have various reasons:
|
24
|
+
|
25
|
+
* You did not setup an integration, see:
|
26
|
+
https://github.com/mbj/mutant/blob/main/docs/configuration.md#integration
|
27
|
+
* You set environment variables like RSPEC_OPTS that filter out all tests.
|
28
|
+
* You set configuration optiosn like `config.filter_run :focus` which do
|
29
|
+
make rspec to not report any test.
|
30
|
+
===============
|
31
|
+
MESSAGE
|
32
|
+
|
19
33
|
# Test if command needs to be executed in zombie environment
|
20
34
|
#
|
21
35
|
# @return [Bool]
|
@@ -28,10 +42,19 @@ module Mutant
|
|
28
42
|
def action
|
29
43
|
soft_fail(License.call(world))
|
30
44
|
.bind { bootstrap }
|
45
|
+
.bind(&method(:validate_tests))
|
31
46
|
.bind(&Runner.public_method(:call))
|
32
47
|
.bind(&method(:from_result))
|
33
48
|
end
|
34
49
|
|
50
|
+
def validate_tests(environment)
|
51
|
+
if environment.integration.all_tests.length.zero?
|
52
|
+
Either::Left.new(NO_TESTS_MESSAGE)
|
53
|
+
else
|
54
|
+
Either::Right.new(environment)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
35
58
|
def from_result(result)
|
36
59
|
if result.success?
|
37
60
|
Either::Right.new(nil)
|
data/lib/mutant/cli/command.rb
CHANGED
@@ -21,8 +21,11 @@ module Mutant
|
|
21
21
|
emit_singletons
|
22
22
|
emit_promotions
|
23
23
|
emit_operator_mutations
|
24
|
-
|
25
|
-
emit_left_mutations
|
24
|
+
|
25
|
+
emit_left_mutations do |mutation|
|
26
|
+
!(n_irange?(mutation) || n_erange?(mutation)) || !mutation.children.fetch(1).nil?
|
27
|
+
end
|
28
|
+
|
26
29
|
emit_right_mutations
|
27
30
|
end
|
28
31
|
|
@@ -35,10 +38,6 @@ module Mutant
|
|
35
38
|
emit(right)
|
36
39
|
end
|
37
40
|
|
38
|
-
def emit_left_negation
|
39
|
-
emit(s(node.type, n_not(left), right))
|
40
|
-
end
|
41
|
-
|
42
41
|
end # Binary
|
43
42
|
end # Node
|
44
43
|
end # Mutator
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mutant
|
4
|
+
class Mutator
|
5
|
+
class Node
|
6
|
+
class Numblock < self
|
7
|
+
|
8
|
+
handle(:numblock)
|
9
|
+
|
10
|
+
children :receiver, :count, :block
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def dispatch
|
15
|
+
emit_nil
|
16
|
+
emit_receiver_mutations(&method(:n_send?))
|
17
|
+
end
|
18
|
+
end # Numblock
|
19
|
+
end # Node
|
20
|
+
end # Mutator
|
21
|
+
end # Mutant
|
@@ -8,7 +8,7 @@ module Mutant
|
|
8
8
|
class Mutation < self
|
9
9
|
NO_DIFF_MESSAGE = <<~'MESSAGE'
|
10
10
|
--- Internal failure ---
|
11
|
-
BUG: A
|
11
|
+
BUG: A generated mutation did not result in exactly one diff hunk!
|
12
12
|
This is an invariant violation by the mutation generation engine.
|
13
13
|
Please report a reproduction to https://github.com/mbj/mutant
|
14
14
|
Original unparsed source:
|
@@ -27,7 +27,7 @@ module Mutant
|
|
27
27
|
|
28
28
|
NO_DIFF_MESSAGE = <<~'MESSAGE'
|
29
29
|
--- Internal failure ---
|
30
|
-
BUG: A
|
30
|
+
BUG: A generated mutation did not result in exactly one diff hunk!
|
31
31
|
This is an invariant violation by the mutation generation engine.
|
32
32
|
Please report a reproduction to https://github.com/mbj/mutant
|
33
33
|
Original unparsed source:
|
data/lib/mutant/version.rb
CHANGED
data/lib/mutant.rb
CHANGED
@@ -152,6 +152,7 @@ require 'mutant/mutator/node/match_current_line'
|
|
152
152
|
require 'mutant/mutator/node/index'
|
153
153
|
require 'mutant/mutator/node/procarg_zero'
|
154
154
|
require 'mutant/mutator/node/kwargs'
|
155
|
+
require 'mutant/mutator/node/numblock'
|
155
156
|
require 'mutant/loader'
|
156
157
|
require 'mutant/context'
|
157
158
|
require 'mutant/scope'
|
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.10.
|
4
|
+
version: 0.10.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|
@@ -269,6 +269,7 @@ files:
|
|
269
269
|
- lib/mutant/mutator/node/next.rb
|
270
270
|
- lib/mutant/mutator/node/noop.rb
|
271
271
|
- lib/mutant/mutator/node/nthref.rb
|
272
|
+
- lib/mutant/mutator/node/numblock.rb
|
272
273
|
- lib/mutant/mutator/node/op_asgn.rb
|
273
274
|
- lib/mutant/mutator/node/or_asgn.rb
|
274
275
|
- lib/mutant/mutator/node/procarg_zero.rb
|