mutant 0.10.17 → 0.10.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mutant.rb +3 -0
- data/lib/mutant/ast/meta/send.rb +0 -1
- data/lib/mutant/ast/types.rb +0 -9
- data/lib/mutant/bootstrap.rb +2 -2
- data/lib/mutant/cli/command/environment.rb +4 -4
- data/lib/mutant/cli/command/environment/run.rb +2 -2
- data/lib/mutant/cli/command/environment/show.rb +1 -2
- data/lib/mutant/cli/command/environment/subject.rb +39 -0
- data/lib/mutant/cli/command/root.rb +1 -1
- data/lib/mutant/cli/command/subscription.rb +1 -1
- data/lib/mutant/env.rb +8 -6
- data/lib/mutant/expression.rb +12 -3
- data/lib/mutant/expression/method.rb +33 -8
- data/lib/mutant/expression/methods.rb +6 -4
- data/lib/mutant/expression/namespace.rb +17 -6
- data/lib/mutant/expression/parser.rb +2 -2
- data/lib/mutant/integration/null.rb +2 -3
- data/lib/mutant/isolation/fork.rb +1 -1
- data/lib/mutant/license.rb +1 -1
- data/lib/mutant/license/subscription.rb +1 -1
- data/lib/mutant/license/subscription/commercial.rb +1 -1
- data/lib/mutant/license/subscription/opensource.rb +1 -1
- data/lib/mutant/mutator/node/arguments.rb +0 -2
- data/lib/mutant/mutator/node/block.rb +5 -1
- data/lib/mutant/mutator/node/defined.rb +12 -3
- data/lib/mutant/mutator/node/kwargs.rb +34 -0
- data/lib/mutant/mutator/node/literal/symbol.rb +0 -2
- data/lib/mutant/mutator/node/procarg_zero.rb +0 -6
- data/lib/mutant/mutator/node/send.rb +20 -18
- data/lib/mutant/parallel.rb +43 -28
- data/lib/mutant/parallel/driver.rb +9 -3
- data/lib/mutant/parallel/worker.rb +60 -2
- data/lib/mutant/pipe.rb +94 -0
- data/lib/mutant/reporter/cli/printer/isolation_result.rb +1 -6
- data/lib/mutant/result.rb +9 -6
- data/lib/mutant/runner.rb +8 -11
- data/lib/mutant/runner/sink.rb +12 -2
- data/lib/mutant/subject/method/instance.rb +1 -1
- data/lib/mutant/test.rb +1 -1
- data/lib/mutant/timer.rb +2 -4
- data/lib/mutant/transform.rb +0 -2
- data/lib/mutant/version.rb +1 -1
- metadata +12 -9
@@ -12,11 +12,6 @@ module Mutant
|
|
12
12
|
%s
|
13
13
|
MESSAGE
|
14
14
|
|
15
|
-
LOG_MESSAGES = <<~'MESSAGE'
|
16
|
-
Log messages (combined stderr and stdout):
|
17
|
-
%s
|
18
|
-
MESSAGE
|
19
|
-
|
20
15
|
EXCEPTION_ERROR_MESSAGE = <<~'MESSAGE'
|
21
16
|
Killing the mutation resulted in an integration error.
|
22
17
|
This is the case when the tests selected for the current mutation
|
@@ -36,7 +31,7 @@ module Mutant
|
|
36
31
|
```
|
37
32
|
MESSAGE
|
38
33
|
|
39
|
-
TIMEOUT_ERROR_MESSAGE
|
34
|
+
TIMEOUT_ERROR_MESSAGE = <<~'MESSAGE'
|
40
35
|
Mutation analysis ran into the configured timeout of %0.9<timeout>g seconds.
|
41
36
|
MESSAGE
|
42
37
|
|
data/lib/mutant/result.rb
CHANGED
@@ -121,11 +121,7 @@ module Mutant
|
|
121
121
|
|
122
122
|
# Test result
|
123
123
|
class Test
|
124
|
-
include
|
125
|
-
:passed,
|
126
|
-
:runtime,
|
127
|
-
:tests
|
128
|
-
)
|
124
|
+
include Anima.new(:passed, :runtime)
|
129
125
|
|
130
126
|
class VoidValue < self
|
131
127
|
include Singleton
|
@@ -137,7 +133,6 @@ module Mutant
|
|
137
133
|
super(
|
138
134
|
passed: false,
|
139
135
|
runtime: 0.0,
|
140
|
-
tests: []
|
141
136
|
)
|
142
137
|
end
|
143
138
|
end # VoidValue
|
@@ -237,6 +232,14 @@ module Mutant
|
|
237
232
|
end
|
238
233
|
end
|
239
234
|
|
235
|
+
class MutationIndex
|
236
|
+
include Anima.new(
|
237
|
+
:isolation_result,
|
238
|
+
:mutation_index,
|
239
|
+
:runtime
|
240
|
+
)
|
241
|
+
end # MutationIndex
|
242
|
+
|
240
243
|
# Mutation result
|
241
244
|
class Mutation
|
242
245
|
include Result, Anima.new(
|
data/lib/mutant/runner.rb
CHANGED
@@ -6,7 +6,7 @@ module Mutant
|
|
6
6
|
# Run against env
|
7
7
|
#
|
8
8
|
# @return [Either<String, Result>]
|
9
|
-
def self.
|
9
|
+
def self.call(env)
|
10
10
|
reporter(env).start(env)
|
11
11
|
|
12
12
|
Either::Right.new(run_mutation_analysis(env))
|
@@ -17,7 +17,7 @@ module Mutant
|
|
17
17
|
|
18
18
|
run_driver(
|
19
19
|
reporter,
|
20
|
-
Parallel.async(mutation_test_config(env))
|
20
|
+
Parallel.async(env.world, mutation_test_config(env))
|
21
21
|
).tap do |result|
|
22
22
|
reporter.report(result)
|
23
23
|
end
|
@@ -34,16 +34,13 @@ module Mutant
|
|
34
34
|
private_class_method :run_driver
|
35
35
|
|
36
36
|
def self.mutation_test_config(env)
|
37
|
-
world = env.world
|
38
|
-
|
39
37
|
Parallel::Config.new(
|
40
|
-
|
41
|
-
jobs:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
thread: world.thread
|
38
|
+
block: env.method(:cover_index),
|
39
|
+
jobs: env.config.jobs,
|
40
|
+
process_name: 'mutant-worker-process',
|
41
|
+
sink: Sink.new(env),
|
42
|
+
source: Parallel::Source::Array.new(env.mutations.each_index.to_a),
|
43
|
+
thread_name: 'mutant-worker-thread'
|
47
44
|
)
|
48
45
|
end
|
49
46
|
private_class_method :mutation_test_config
|
data/lib/mutant/runner/sink.rb
CHANGED
@@ -34,10 +34,12 @@ module Mutant
|
|
34
34
|
|
35
35
|
# Handle mutation finish
|
36
36
|
#
|
37
|
-
# @param [Result::
|
37
|
+
# @param [Result::MutationIndex] mutation_index_result
|
38
38
|
#
|
39
39
|
# @return [self]
|
40
|
-
def result(
|
40
|
+
def result(mutation_index_result)
|
41
|
+
mutation_result = mutation_result(mutation_index_result)
|
42
|
+
|
41
43
|
subject = mutation_result.mutation.subject
|
42
44
|
|
43
45
|
@subject_results[subject] = Result::Subject.new(
|
@@ -58,6 +60,14 @@ module Mutant
|
|
58
60
|
)
|
59
61
|
end
|
60
62
|
|
63
|
+
def mutation_result(mutation_index_result)
|
64
|
+
Result::Mutation.new(
|
65
|
+
isolation_result: mutation_index_result.isolation_result,
|
66
|
+
mutation: env.mutations.fetch(mutation_index_result.mutation_index),
|
67
|
+
runtime: mutation_index_result.runtime
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
61
71
|
def previous_coverage_results(subject)
|
62
72
|
subject_result = @subject_results.fetch(subject) { return EMPTY_ARRAY }
|
63
73
|
subject_result.coverage_results
|
data/lib/mutant/test.rb
CHANGED
data/lib/mutant/timer.rb
CHANGED
@@ -14,8 +14,8 @@ module Mutant
|
|
14
14
|
class Deadline
|
15
15
|
include Anima.new(:timer, :allowed_time)
|
16
16
|
|
17
|
-
def initialize(
|
18
|
-
super(
|
17
|
+
def initialize(*arguments)
|
18
|
+
super(*arguments)
|
19
19
|
@start_at = timer.now
|
20
20
|
end
|
21
21
|
|
@@ -54,8 +54,6 @@ module Mutant
|
|
54
54
|
class None < self
|
55
55
|
include Concord.new
|
56
56
|
|
57
|
-
STATUS = Status.new(nil)
|
58
|
-
|
59
57
|
# The time left
|
60
58
|
#
|
61
59
|
# @return [Float, nil]
|
data/lib/mutant/transform.rb
CHANGED
data/lib/mutant/version.rb
CHANGED
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.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: abstract_type
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 3.0.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: 3.0.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: procto
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0.5.
|
187
|
+
version: 0.5.6
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0.5.
|
194
|
+
version: 0.5.6
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: variable
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,14 +268,14 @@ dependencies:
|
|
268
268
|
requirements:
|
269
269
|
- - "~>"
|
270
270
|
- !ruby/object:Gem::Version
|
271
|
-
version: '1.
|
271
|
+
version: '1.7'
|
272
272
|
type: :development
|
273
273
|
prerelease: false
|
274
274
|
version_requirements: !ruby/object:Gem::Requirement
|
275
275
|
requirements:
|
276
276
|
- - "~>"
|
277
277
|
- !ruby/object:Gem::Version
|
278
|
-
version: '1.
|
278
|
+
version: '1.7'
|
279
279
|
description: Mutation Testing for Ruby.
|
280
280
|
email:
|
281
281
|
- mbj@schirp-dso.com
|
@@ -307,6 +307,7 @@ files:
|
|
307
307
|
- lib/mutant/cli/command/environment.rb
|
308
308
|
- lib/mutant/cli/command/environment/run.rb
|
309
309
|
- lib/mutant/cli/command/environment/show.rb
|
310
|
+
- lib/mutant/cli/command/environment/subject.rb
|
310
311
|
- lib/mutant/cli/command/root.rb
|
311
312
|
- lib/mutant/cli/command/subscription.rb
|
312
313
|
- lib/mutant/config.rb
|
@@ -365,6 +366,7 @@ files:
|
|
365
366
|
- lib/mutant/mutator/node/generic.rb
|
366
367
|
- lib/mutant/mutator/node/if.rb
|
367
368
|
- lib/mutant/mutator/node/index.rb
|
369
|
+
- lib/mutant/mutator/node/kwargs.rb
|
368
370
|
- lib/mutant/mutator/node/kwbegin.rb
|
369
371
|
- lib/mutant/mutator/node/literal.rb
|
370
372
|
- lib/mutant/mutator/node/literal/array.rb
|
@@ -411,6 +413,7 @@ files:
|
|
411
413
|
- lib/mutant/parallel/source.rb
|
412
414
|
- lib/mutant/parallel/worker.rb
|
413
415
|
- lib/mutant/parser.rb
|
416
|
+
- lib/mutant/pipe.rb
|
414
417
|
- lib/mutant/range.rb
|
415
418
|
- lib/mutant/registry.rb
|
416
419
|
- lib/mutant/reporter.rb
|
@@ -471,7 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
471
474
|
- !ruby/object:Gem::Version
|
472
475
|
version: '0'
|
473
476
|
requirements: []
|
474
|
-
rubygems_version: 3.
|
477
|
+
rubygems_version: 3.0.3
|
475
478
|
signing_key:
|
476
479
|
specification_version: 4
|
477
480
|
summary: ''
|