mutant 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +7 -0
- data/config/flay.yml +1 -1
- data/config/reek.yml +1 -0
- data/lib/mutant.rb +10 -3
- data/lib/mutant/actor.rb +2 -5
- data/lib/mutant/actor/env.rb +1 -3
- data/lib/mutant/actor/mailbox.rb +2 -4
- data/lib/mutant/actor/receiver.rb +0 -2
- data/lib/mutant/actor/sender.rb +0 -1
- data/lib/mutant/ast.rb +22 -28
- data/lib/mutant/ast/meta.rb +8 -88
- data/lib/mutant/ast/named_children.rb +1 -8
- data/lib/mutant/ast/sexp.rb +0 -2
- data/lib/mutant/cache.rb +1 -3
- data/lib/mutant/cli.rb +9 -19
- data/lib/mutant/color.rb +0 -3
- data/lib/mutant/config.rb +6 -2
- data/lib/mutant/context.rb +2 -4
- data/lib/mutant/context/scope.rb +10 -16
- data/lib/mutant/delegator.rb +0 -3
- data/lib/mutant/diff.rb +8 -17
- data/lib/mutant/env.rb +3 -5
- data/lib/mutant/env/bootstrap.rb +32 -39
- data/lib/mutant/expression.rb +14 -132
- data/lib/mutant/expression/method.rb +25 -42
- data/lib/mutant/expression/methods.rb +17 -29
- data/lib/mutant/expression/namespace.rb +33 -28
- data/lib/mutant/expression/parser.rb +71 -0
- data/lib/mutant/integration.rb +17 -16
- data/lib/mutant/isolation.rb +14 -14
- data/lib/mutant/loader.rb +2 -4
- data/lib/mutant/matcher.rb +1 -11
- data/lib/mutant/matcher/chain.rb +0 -1
- data/lib/mutant/matcher/compiler.rb +19 -52
- data/lib/mutant/matcher/config.rb +65 -5
- data/lib/mutant/matcher/filter.rb +11 -1
- data/lib/mutant/matcher/method.rb +11 -21
- data/lib/mutant/matcher/method/instance.rb +2 -16
- data/lib/mutant/matcher/method/singleton.rb +3 -20
- data/lib/mutant/matcher/methods.rb +11 -21
- data/lib/mutant/matcher/namespace.rb +0 -4
- data/lib/mutant/matcher/null.rb +0 -1
- data/lib/mutant/matcher/scope.rb +0 -12
- data/lib/mutant/meta.rb +0 -1
- data/lib/mutant/meta/example.rb +12 -26
- data/lib/mutant/meta/example/dsl.rb +1 -8
- data/lib/mutant/mutation.rb +6 -14
- data/lib/mutant/mutator.rb +2 -14
- data/lib/mutant/mutator/node.rb +6 -33
- data/lib/mutant/mutator/node/and_asgn.rb +0 -1
- data/lib/mutant/mutator/node/argument.rb +0 -5
- data/lib/mutant/mutator/node/arguments.rb +1 -7
- data/lib/mutant/mutator/node/begin.rb +0 -2
- data/lib/mutant/mutator/node/binary.rb +0 -3
- data/lib/mutant/mutator/node/block.rb +0 -2
- data/lib/mutant/mutator/node/break.rb +0 -1
- data/lib/mutant/mutator/node/case.rb +0 -3
- data/lib/mutant/mutator/node/conditional_loop.rb +0 -1
- data/lib/mutant/mutator/node/const.rb +0 -1
- data/lib/mutant/mutator/node/define.rb +0 -1
- data/lib/mutant/mutator/node/defined.rb +0 -1
- data/lib/mutant/mutator/node/dstr.rb +0 -1
- data/lib/mutant/mutator/node/dsym.rb +0 -1
- data/lib/mutant/mutator/node/generic.rb +0 -1
- data/lib/mutant/mutator/node/if.rb +0 -4
- data/lib/mutant/mutator/node/kwbegin.rb +0 -1
- data/lib/mutant/mutator/node/literal/array.rb +0 -2
- data/lib/mutant/mutator/node/literal/boolean.rb +0 -1
- data/lib/mutant/mutator/node/literal/fixnum.rb +2 -5
- data/lib/mutant/mutator/node/literal/float.rb +1 -4
- data/lib/mutant/mutator/node/literal/hash.rb +0 -3
- data/lib/mutant/mutator/node/literal/nil.rb +0 -1
- data/lib/mutant/mutator/node/literal/range.rb +1 -5
- data/lib/mutant/mutator/node/literal/regex.rb +1 -3
- data/lib/mutant/mutator/node/literal/string.rb +0 -1
- data/lib/mutant/mutator/node/literal/symbol.rb +0 -1
- data/lib/mutant/mutator/node/masgn.rb +0 -1
- data/lib/mutant/mutator/node/match_current_line.rb +0 -1
- data/lib/mutant/mutator/node/mlhs.rb +0 -1
- data/lib/mutant/mutator/node/named_value/access.rb +0 -1
- data/lib/mutant/mutator/node/named_value/constant_assignment.rb +0 -2
- data/lib/mutant/mutator/node/named_value/variable_assignment.rb +0 -2
- data/lib/mutant/mutator/node/next.rb +0 -1
- data/lib/mutant/mutator/node/noop.rb +0 -1
- data/lib/mutant/mutator/node/nthref.rb +0 -1
- data/lib/mutant/mutator/node/op_asgn.rb +0 -1
- data/lib/mutant/mutator/node/or_asgn.rb +1 -2
- data/lib/mutant/mutator/node/resbody.rb +0 -2
- data/lib/mutant/mutator/node/rescue.rb +1 -6
- data/lib/mutant/mutator/node/return.rb +0 -1
- data/lib/mutant/mutator/node/send.rb +16 -17
- data/lib/mutant/mutator/node/send/attribute_assignment.rb +0 -3
- data/lib/mutant/mutator/node/send/binary.rb +0 -1
- data/lib/mutant/mutator/node/send/index.rb +0 -3
- data/lib/mutant/mutator/node/splat.rb +0 -1
- data/lib/mutant/mutator/node/super.rb +0 -1
- data/lib/mutant/mutator/node/when.rb +2 -7
- data/lib/mutant/mutator/node/yield.rb +0 -1
- data/lib/mutant/mutator/node/zsuper.rb +0 -1
- data/lib/mutant/mutator/registry.rb +1 -4
- data/lib/mutant/mutator/util.rb +0 -2
- data/lib/mutant/mutator/util/array.rb +0 -3
- data/lib/mutant/mutator/util/symbol.rb +0 -1
- data/lib/mutant/parallel.rb +3 -9
- data/lib/mutant/parallel/master.rb +7 -17
- data/lib/mutant/parallel/source.rb +2 -7
- data/lib/mutant/parallel/worker.rb +1 -5
- data/lib/mutant/reporter.rb +0 -4
- data/lib/mutant/reporter/cli.rb +1 -8
- data/lib/mutant/reporter/cli/format.rb +7 -18
- data/lib/mutant/reporter/cli/printer.rb +2 -12
- data/lib/mutant/reporter/cli/printer/config.rb +1 -4
- data/lib/mutant/reporter/cli/printer/env_progress.rb +3 -7
- data/lib/mutant/reporter/cli/printer/env_result.rb +0 -1
- data/lib/mutant/reporter/cli/printer/mutation_progress_result.rb +0 -2
- data/lib/mutant/reporter/cli/printer/mutation_result.rb +3 -11
- data/lib/mutant/reporter/cli/printer/status.rb +1 -4
- data/lib/mutant/reporter/cli/printer/status_progressive.rb +1 -3
- data/lib/mutant/reporter/cli/printer/subject_progress.rb +0 -5
- data/lib/mutant/reporter/cli/printer/subject_result.rb +0 -1
- data/lib/mutant/reporter/cli/printer/test_result.rb +0 -1
- data/lib/mutant/reporter/cli/tput.rb +4 -1
- data/lib/mutant/reporter/trace.rb +2 -4
- data/lib/mutant/repository.rb +88 -0
- data/lib/mutant/require_highjack.rb +0 -1
- data/lib/mutant/result.rb +25 -48
- data/lib/mutant/runner.rb +7 -16
- data/lib/mutant/runner/sink.rb +3 -11
- data/lib/mutant/selector.rb +1 -2
- data/lib/mutant/selector/expression.rb +1 -2
- data/lib/mutant/subject.rb +10 -21
- data/lib/mutant/subject/method.rb +11 -12
- data/lib/mutant/subject/method/instance.rb +1 -5
- data/lib/mutant/subject/method/singleton.rb +1 -3
- data/lib/mutant/test.rb +1 -2
- data/lib/mutant/version.rb +2 -2
- data/lib/mutant/warning_filter.rb +2 -7
- data/lib/mutant/zombifier.rb +6 -10
- data/meta/send.rb +8 -0
- data/spec/spec_helper.rb +5 -1
- data/spec/support/corpus.rb +5 -9
- data/spec/support/rb_bug.rb +0 -1
- data/spec/support/rspec.rb +0 -1
- data/spec/support/ruby_vm.rb +0 -2
- data/spec/unit/mutant/ast/meta/send_spec.rb +42 -0
- data/spec/unit/mutant/ast/named_children_spec.rb +51 -0
- data/spec/unit/mutant/ast/sexp_spec.rb +36 -0
- data/spec/unit/mutant/ast_spec.rb +8 -0
- data/spec/unit/mutant/cli_spec.rb +34 -19
- data/spec/unit/mutant/context/scope_spec.rb +11 -0
- data/spec/unit/mutant/env/boostrap_spec.rb +5 -2
- data/spec/unit/mutant/env_spec.rb +14 -15
- data/spec/unit/mutant/expression/method_spec.rb +10 -14
- data/spec/unit/mutant/expression/methods_spec.rb +24 -11
- data/spec/unit/mutant/expression/namespace/flat_spec.rb +5 -6
- data/spec/unit/mutant/expression/namespace/recursive_spec.rb +16 -10
- data/spec/unit/mutant/expression/parser_spec.rb +67 -0
- data/spec/unit/mutant/expression_spec.rb +24 -57
- data/spec/unit/mutant/integration/rspec_spec.rb +7 -7
- data/spec/unit/mutant/integration_spec.rb +2 -2
- data/spec/unit/mutant/isolation_spec.rb +31 -29
- data/spec/unit/mutant/matcher/compiler/subject_prefix_spec.rb +2 -2
- data/spec/unit/mutant/matcher/compiler_spec.rb +27 -58
- data/spec/unit/mutant/matcher/config_spec.rb +45 -0
- data/spec/unit/mutant/matcher/filter_spec.rb +12 -5
- data/spec/unit/mutant/matcher/method/instance_spec.rb +0 -1
- data/spec/unit/mutant/matcher/method/singleton_spec.rb +0 -1
- data/spec/unit/mutant/matcher/namespace_spec.rb +4 -4
- data/spec/unit/mutant/parallel/worker_spec.rb +1 -1
- data/spec/unit/mutant/reporter/cli/printer/config_spec.rb +4 -4
- data/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb +7 -7
- data/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb +2 -2
- data/spec/unit/mutant/reporter/cli/printer/status_progressive_spec.rb +2 -2
- data/spec/unit/mutant/reporter/cli/printer/status_spec.rb +12 -12
- data/spec/unit/mutant/reporter/cli/printer/subject_progress_spec.rb +1 -1
- data/spec/unit/mutant/reporter/cli_spec.rb +9 -10
- data/spec/unit/mutant/repository/diff_spec.rb +80 -0
- data/spec/unit/mutant/repository/subject_filter_spec.rb +28 -0
- data/spec/unit/mutant/result/env_spec.rb +1 -1
- data/spec/unit/mutant/runner_spec.rb +0 -1
- data/spec/unit/mutant/selector/expression_spec.rb +14 -14
- data/spec/unit/mutant/subject/method/instance_spec.rb +2 -2
- data/spec/unit/mutant/subject/method/singleton_spec.rb +2 -2
- data/spec/unit/mutant/subject_spec.rb +5 -2
- metadata +20 -3
- data/spec/support/mutation_verifier.rb +0 -96
@@ -6,7 +6,7 @@ module Mutant
|
|
6
6
|
|
7
7
|
NoJobError = Class.new(RuntimeError)
|
8
8
|
|
9
|
-
#
|
9
|
+
# Next job
|
10
10
|
#
|
11
11
|
# @return [Object]
|
12
12
|
#
|
@@ -14,7 +14,6 @@ module Mutant
|
|
14
14
|
# when no next job is available
|
15
15
|
#
|
16
16
|
# @api private
|
17
|
-
#
|
18
17
|
abstract_method :next
|
19
18
|
|
20
19
|
# Test if next job is available
|
@@ -22,7 +21,6 @@ module Mutant
|
|
22
21
|
# @return [Boolean]
|
23
22
|
#
|
24
23
|
# @api private
|
25
|
-
#
|
26
24
|
abstract_method :next?
|
27
25
|
|
28
26
|
# Job source backed by a finite array
|
@@ -34,7 +32,6 @@ module Mutant
|
|
34
32
|
# @return [undefined]
|
35
33
|
#
|
36
34
|
# @api private
|
37
|
-
#
|
38
35
|
def initialize(*)
|
39
36
|
super
|
40
37
|
|
@@ -46,12 +43,11 @@ module Mutant
|
|
46
43
|
# @return [Boolean]
|
47
44
|
#
|
48
45
|
# @api private
|
49
|
-
#
|
50
46
|
def next?
|
51
47
|
@next_index < jobs.length
|
52
48
|
end
|
53
49
|
|
54
|
-
#
|
50
|
+
# Next job
|
55
51
|
#
|
56
52
|
# @return [Object]
|
57
53
|
#
|
@@ -59,7 +55,6 @@ module Mutant
|
|
59
55
|
# when no next job is available
|
60
56
|
#
|
61
57
|
# @api private
|
62
|
-
#
|
63
58
|
def next
|
64
59
|
fail NoJobError unless next?
|
65
60
|
jobs.fetch(@next_index).tap do
|
@@ -11,7 +11,6 @@ module Mutant
|
|
11
11
|
# @return [self]
|
12
12
|
#
|
13
13
|
# @api private
|
14
|
-
#
|
15
14
|
def self.run(attributes)
|
16
15
|
new(attributes).run
|
17
16
|
self
|
@@ -23,10 +22,9 @@ module Mutant
|
|
23
22
|
#
|
24
23
|
# @return [self]
|
25
24
|
#
|
26
|
-
# @api private
|
27
|
-
#
|
28
25
|
# rubocop:disable Lint/Loop
|
29
26
|
#
|
27
|
+
# @api private
|
30
28
|
def run
|
31
29
|
begin
|
32
30
|
parent.call(Actor::Message.new(:ready, mailbox.sender))
|
@@ -42,7 +40,6 @@ module Mutant
|
|
42
40
|
# @return [Boolean]
|
43
41
|
#
|
44
42
|
# @api private
|
45
|
-
#
|
46
43
|
def handle(message)
|
47
44
|
type, payload = message.type, message.payload
|
48
45
|
case message.type
|
@@ -63,7 +60,6 @@ module Mutant
|
|
63
60
|
# @return [undefined]
|
64
61
|
#
|
65
62
|
# @api private
|
66
|
-
#
|
67
63
|
def handle_job(job)
|
68
64
|
result = processor.call(job.payload)
|
69
65
|
parent.call(Actor::Message.new(:result, JobResult.new(job: job, payload: result)))
|
data/lib/mutant/reporter.rb
CHANGED
@@ -10,7 +10,6 @@ module Mutant
|
|
10
10
|
# @return [self]
|
11
11
|
#
|
12
12
|
# @api private
|
13
|
-
#
|
14
13
|
abstract_method :warn
|
15
14
|
|
16
15
|
# Report start
|
@@ -20,7 +19,6 @@ module Mutant
|
|
20
19
|
# @return [self]
|
21
20
|
#
|
22
21
|
# @api private
|
23
|
-
#
|
24
22
|
abstract_method :start
|
25
23
|
|
26
24
|
# Report collector state
|
@@ -30,7 +28,6 @@ module Mutant
|
|
30
28
|
# @return [self]
|
31
29
|
#
|
32
30
|
# @api private
|
33
|
-
#
|
34
31
|
abstract_method :report
|
35
32
|
|
36
33
|
# Report progress on object
|
@@ -40,7 +37,6 @@ module Mutant
|
|
40
37
|
# @return [self]
|
41
38
|
#
|
42
39
|
# @api private
|
43
|
-
#
|
44
40
|
abstract_method :progress
|
45
41
|
|
46
42
|
end # Reporter
|
data/lib/mutant/reporter/cli.rb
CHANGED
@@ -11,7 +11,6 @@ module Mutant
|
|
11
11
|
# @return [Reporter::CLI]
|
12
12
|
#
|
13
13
|
# @api private
|
14
|
-
#
|
15
14
|
def self.build(output)
|
16
15
|
tput = Tput.detect
|
17
16
|
tty = output.respond_to?(:tty?) && output.tty?
|
@@ -30,7 +29,6 @@ module Mutant
|
|
30
29
|
# @return [self]
|
31
30
|
#
|
32
31
|
# @api private
|
33
|
-
#
|
34
32
|
def start(env)
|
35
33
|
write(format.start(env))
|
36
34
|
self
|
@@ -43,20 +41,18 @@ module Mutant
|
|
43
41
|
# @return [self]
|
44
42
|
#
|
45
43
|
# @api private
|
46
|
-
#
|
47
44
|
def progress(status)
|
48
45
|
write(format.progress(status))
|
49
46
|
self
|
50
47
|
end
|
51
48
|
|
52
|
-
#
|
49
|
+
# Report delay in seconds
|
53
50
|
#
|
54
51
|
# TODO: Move this to a callback registration
|
55
52
|
#
|
56
53
|
# @return [Float]
|
57
54
|
#
|
58
55
|
# @api private
|
59
|
-
#
|
60
56
|
def delay
|
61
57
|
format.delay
|
62
58
|
end
|
@@ -68,7 +64,6 @@ module Mutant
|
|
68
64
|
# @return [self]
|
69
65
|
#
|
70
66
|
# @api private
|
71
|
-
#
|
72
67
|
def warn(message)
|
73
68
|
output.puts(message)
|
74
69
|
self
|
@@ -81,7 +76,6 @@ module Mutant
|
|
81
76
|
# @return [self]
|
82
77
|
#
|
83
78
|
# @api private
|
84
|
-
#
|
85
79
|
def report(env)
|
86
80
|
Printer::EnvResult.call(output, env)
|
87
81
|
self
|
@@ -96,7 +90,6 @@ module Mutant
|
|
96
90
|
# @return [undefined]
|
97
91
|
#
|
98
92
|
# @api private
|
99
|
-
#
|
100
93
|
def write(frame)
|
101
94
|
output.write(frame)
|
102
95
|
end
|
@@ -5,32 +5,29 @@ module Mutant
|
|
5
5
|
class Format
|
6
6
|
include AbstractType, Anima.new(:tty)
|
7
7
|
|
8
|
-
#
|
8
|
+
# Start representation
|
9
9
|
#
|
10
10
|
# @param [Env] env
|
11
11
|
#
|
12
12
|
# @return [String]
|
13
13
|
#
|
14
14
|
# @api private
|
15
|
-
#
|
16
15
|
abstract_method :start
|
17
16
|
|
18
|
-
#
|
17
|
+
# Progress representation
|
19
18
|
#
|
20
19
|
# @param [Runner::Status] status
|
21
20
|
#
|
22
21
|
# @return [String]
|
23
22
|
#
|
24
23
|
# @api private
|
25
|
-
#
|
26
24
|
abstract_method :progress
|
27
25
|
|
28
|
-
#
|
26
|
+
# Report delay in seconds
|
29
27
|
#
|
30
28
|
# @return [Float]
|
31
29
|
#
|
32
30
|
# @api private
|
33
|
-
#
|
34
31
|
def delay
|
35
32
|
self.class::REPORT_DELAY
|
36
33
|
end
|
@@ -44,7 +41,6 @@ module Mutant
|
|
44
41
|
# @return [Boolean]
|
45
42
|
#
|
46
43
|
# @api private
|
47
|
-
#
|
48
44
|
def tty?
|
49
45
|
@tty
|
50
46
|
end
|
@@ -66,7 +62,6 @@ module Mutant
|
|
66
62
|
# @return [String]
|
67
63
|
#
|
68
64
|
# @api private
|
69
|
-
#
|
70
65
|
def format(printer, object)
|
71
66
|
buffer = new_buffer
|
72
67
|
printer.call(Output.new(tty, buffer), object)
|
@@ -80,34 +75,31 @@ module Mutant
|
|
80
75
|
REPORT_FREQUENCY = 1.0
|
81
76
|
REPORT_DELAY = 1 / REPORT_FREQUENCY
|
82
77
|
|
83
|
-
#
|
78
|
+
# Start representation
|
84
79
|
#
|
85
80
|
# @return [String]
|
86
81
|
#
|
87
82
|
# @api private
|
88
|
-
#
|
89
83
|
def start(env)
|
90
84
|
format(Printer::Config, env.config)
|
91
85
|
end
|
92
86
|
|
93
|
-
#
|
87
|
+
# Progress representation
|
94
88
|
#
|
95
89
|
# @return [String]
|
96
90
|
#
|
97
91
|
# @api private
|
98
|
-
#
|
99
92
|
def progress(status)
|
100
93
|
format(Printer::StatusProgressive, status)
|
101
94
|
end
|
102
95
|
|
103
96
|
private
|
104
97
|
|
105
|
-
#
|
98
|
+
# New buffer
|
106
99
|
#
|
107
100
|
# @return [StringIO]
|
108
101
|
#
|
109
102
|
# @api private
|
110
|
-
#
|
111
103
|
def new_buffer
|
112
104
|
StringIO.new
|
113
105
|
end
|
@@ -130,7 +122,6 @@ module Mutant
|
|
130
122
|
# @return [String]
|
131
123
|
#
|
132
124
|
# @api private
|
133
|
-
#
|
134
125
|
def start(_env)
|
135
126
|
tput.prepare
|
136
127
|
end
|
@@ -142,19 +133,17 @@ module Mutant
|
|
142
133
|
# @return [String]
|
143
134
|
#
|
144
135
|
# @api private
|
145
|
-
#
|
146
136
|
def progress(status)
|
147
137
|
format(Printer::Status, status)
|
148
138
|
end
|
149
139
|
|
150
140
|
private
|
151
141
|
|
152
|
-
#
|
142
|
+
# New buffer
|
153
143
|
#
|
154
144
|
# @return [StringIO]
|
155
145
|
#
|
156
146
|
# @api private
|
157
|
-
#
|
158
147
|
def new_buffer
|
159
148
|
# For some reason this raises an Ernno::EACCESS errror:
|
160
149
|
#
|
@@ -16,17 +16,15 @@ module Mutant
|
|
16
16
|
# @return [self]
|
17
17
|
#
|
18
18
|
# @api private
|
19
|
-
#
|
20
19
|
abstract_method :run
|
21
20
|
|
22
21
|
private
|
23
22
|
|
24
|
-
#
|
23
|
+
# Status color
|
25
24
|
#
|
26
25
|
# @return [Color]
|
27
26
|
#
|
28
27
|
# @api private
|
29
|
-
#
|
30
28
|
def status_color
|
31
29
|
success? ? Color::GREEN : Color::RED
|
32
30
|
end
|
@@ -39,7 +37,6 @@ module Mutant
|
|
39
37
|
# @return [undefined]
|
40
38
|
#
|
41
39
|
# @api private
|
42
|
-
#
|
43
40
|
def visit_collection(printer, collection)
|
44
41
|
collection.each do |object|
|
45
42
|
visit(printer, object)
|
@@ -54,7 +51,6 @@ module Mutant
|
|
54
51
|
# @return [undefined]
|
55
52
|
#
|
56
53
|
# @api private
|
57
|
-
#
|
58
54
|
def visit(printer, object)
|
59
55
|
printer.call(output, object)
|
60
56
|
end
|
@@ -64,7 +60,6 @@ module Mutant
|
|
64
60
|
# @return [undefined]
|
65
61
|
#
|
66
62
|
# @api private
|
67
|
-
#
|
68
63
|
def info(string, *arguments)
|
69
64
|
puts(format(string, *arguments))
|
70
65
|
end
|
@@ -74,7 +69,6 @@ module Mutant
|
|
74
69
|
# @return [undefined]
|
75
70
|
#
|
76
71
|
# @api private
|
77
|
-
#
|
78
72
|
def status(string, *arguments)
|
79
73
|
puts(colorize(status_color, format(string, *arguments)))
|
80
74
|
end
|
@@ -84,7 +78,6 @@ module Mutant
|
|
84
78
|
# @return [undefined]
|
85
79
|
#
|
86
80
|
# @api private
|
87
|
-
#
|
88
81
|
def puts(string)
|
89
82
|
output.puts(string)
|
90
83
|
end
|
@@ -94,12 +87,11 @@ module Mutant
|
|
94
87
|
# @param [Color] color
|
95
88
|
# @param [String] message
|
96
89
|
#
|
97
|
-
# @api private
|
98
|
-
#
|
99
90
|
# @return [String]
|
100
91
|
# if color is enabled
|
101
92
|
# unmodified message otherwise
|
102
93
|
#
|
94
|
+
# @api private
|
103
95
|
def colorize(color, message)
|
104
96
|
color = Color::NONE unless tty?
|
105
97
|
color.format(message)
|
@@ -110,7 +102,6 @@ module Mutant
|
|
110
102
|
# @return [Boolean]
|
111
103
|
#
|
112
104
|
# @api private
|
113
|
-
#
|
114
105
|
def tty?
|
115
106
|
output.tty?
|
116
107
|
end
|
@@ -120,7 +111,6 @@ module Mutant
|
|
120
111
|
# @return [Boolean]
|
121
112
|
#
|
122
113
|
# @api private
|
123
|
-
#
|
124
114
|
alias_method :color?, :tty?
|
125
115
|
end # Printer
|
126
116
|
end # CLI
|
@@ -12,13 +12,10 @@ module Mutant
|
|
12
12
|
# @return [undefined]
|
13
13
|
#
|
14
14
|
# @api private
|
15
|
-
#
|
16
|
-
# rubocop:disable AbcSize
|
17
|
-
#
|
18
15
|
def run
|
19
16
|
info 'Mutant configuration:'
|
20
17
|
info 'Matcher: %s', object.matcher.inspect
|
21
|
-
info 'Integration: %s', object.integration
|
18
|
+
info 'Integration: %s', object.integration
|
22
19
|
info 'Expect Coverage: %0.2f%%', (object.expected_coverage * 100)
|
23
20
|
info 'Jobs: %d', object.jobs
|
24
21
|
info 'Includes: %s', object.includes
|
@@ -20,11 +20,9 @@ module Mutant
|
|
20
20
|
#
|
21
21
|
# @return [undefined]
|
22
22
|
#
|
23
|
-
# @api private
|
24
|
-
#
|
25
|
-
# rubocop:disable MethodLength
|
26
23
|
# rubocop:disable AbcSize
|
27
24
|
#
|
25
|
+
# @api private
|
28
26
|
def run
|
29
27
|
visit(Config, env.config)
|
30
28
|
info 'Subjects: %s', amount_subjects
|
@@ -40,22 +38,20 @@ module Mutant
|
|
40
38
|
|
41
39
|
private
|
42
40
|
|
43
|
-
#
|
41
|
+
# Coverage in percent
|
44
42
|
#
|
45
43
|
# @return [Float]
|
46
44
|
#
|
47
45
|
# @api private
|
48
|
-
#
|
49
46
|
def coverage_percent
|
50
47
|
coverage * 100
|
51
48
|
end
|
52
49
|
|
53
|
-
#
|
50
|
+
# Overhead in percent
|
54
51
|
#
|
55
52
|
# @return [Float]
|
56
53
|
#
|
57
54
|
# @api private
|
58
|
-
#
|
59
55
|
def overhead_percent
|
60
56
|
(overhead / killtime) * 100
|
61
57
|
end
|
@@ -12,7 +12,6 @@ module Mutant
|
|
12
12
|
# @return [undefined]
|
13
13
|
#
|
14
14
|
# @api private
|
15
|
-
#
|
16
15
|
def run
|
17
16
|
char(success? ? SUCCESS : FAILURE)
|
18
17
|
end
|
@@ -26,7 +25,6 @@ module Mutant
|
|
26
25
|
# @return [undefined]
|
27
26
|
#
|
28
27
|
# @api private
|
29
|
-
#
|
30
28
|
def char(char)
|
31
29
|
output.write(colorize(status_color, char))
|
32
30
|
end
|