mutant 0.10.1 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/mutant +0 -2
- data/lib/mutant.rb +7 -5
- data/lib/mutant/cli/command.rb +8 -6
- data/lib/mutant/cli/command/run.rb +23 -10
- data/lib/mutant/config.rb +80 -77
- data/lib/mutant/env.rb +14 -4
- data/lib/mutant/integration.rb +7 -10
- data/lib/mutant/integration/null.rb +0 -1
- data/lib/mutant/isolation.rb +11 -48
- data/lib/mutant/isolation/fork.rb +107 -40
- data/lib/mutant/isolation/none.rb +18 -5
- data/lib/mutant/license/subscription.rb +1 -1
- data/lib/mutant/license/subscription/commercial.rb +2 -3
- data/lib/mutant/license/subscription/opensource.rb +2 -2
- data/lib/mutant/matcher/config.rb +13 -0
- data/lib/mutant/matcher/method/instance.rb +0 -2
- data/lib/mutant/mutator/node/send.rb +1 -1
- data/lib/mutant/parallel.rb +0 -1
- data/lib/mutant/parallel/worker.rb +0 -2
- data/lib/mutant/reporter/cli.rb +0 -2
- data/lib/mutant/reporter/cli/printer/config.rb +9 -5
- data/lib/mutant/reporter/cli/printer/coverage_result.rb +19 -0
- data/lib/mutant/reporter/cli/printer/env_progress.rb +2 -0
- data/lib/mutant/reporter/cli/printer/isolation_result.rb +19 -35
- data/lib/mutant/reporter/cli/printer/mutation_result.rb +4 -9
- data/lib/mutant/reporter/cli/printer/subject_result.rb +2 -2
- data/lib/mutant/result.rb +91 -30
- data/lib/mutant/runner/sink.rb +12 -5
- data/lib/mutant/timer.rb +60 -11
- data/lib/mutant/transform.rb +25 -21
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/warnings.rb +0 -1
- data/lib/mutant/world.rb +67 -0
- metadata +12 -14
- data/lib/mutant/minitest/coverage.rb +0 -51
- data/lib/mutant/reporter/cli/printer/mutation_progress_result.rb +0 -28
- data/lib/mutant/reporter/cli/printer/subject_progress.rb +0 -58
- data/lib/mutant/reporter/cli/printer/test_result.rb +0 -32
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'minitest'
|
4
|
-
|
5
|
-
module Mutant
|
6
|
-
module Minitest
|
7
|
-
module Coverage
|
8
|
-
# Setup coverage declaration for current class
|
9
|
-
#
|
10
|
-
# @param [String]
|
11
|
-
#
|
12
|
-
# @example
|
13
|
-
#
|
14
|
-
# class MyTest < MiniTest::Test
|
15
|
-
# cover 'MyCode*'
|
16
|
-
#
|
17
|
-
# def test_some_stuff
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
#
|
21
|
-
# @api public
|
22
|
-
def cover(expression)
|
23
|
-
@cover_expressions = Set.new unless defined?(@cover_expressions)
|
24
|
-
|
25
|
-
@cover_expressions << expression
|
26
|
-
end
|
27
|
-
|
28
|
-
# Effective coverage expression
|
29
|
-
#
|
30
|
-
# @return [Set<String>]
|
31
|
-
#
|
32
|
-
# @api private
|
33
|
-
def resolve_cover_expressions
|
34
|
-
return @cover_expressions if defined?(@cover_expressions)
|
35
|
-
|
36
|
-
try_superclass_cover_expressions
|
37
|
-
end
|
38
|
-
|
39
|
-
private
|
40
|
-
|
41
|
-
def try_superclass_cover_expressions
|
42
|
-
return if superclass.equal?(::Minitest::Runnable)
|
43
|
-
|
44
|
-
superclass.resolve_cover_expressions
|
45
|
-
end
|
46
|
-
|
47
|
-
end # Coverage
|
48
|
-
end # Minitest
|
49
|
-
end # Mutant
|
50
|
-
|
51
|
-
Minitest::Test.extend(Mutant::Minitest::Coverage)
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Mutant
|
4
|
-
class Reporter
|
5
|
-
class CLI
|
6
|
-
class Printer
|
7
|
-
# Printer for mutation progress results
|
8
|
-
class MutationProgressResult < self
|
9
|
-
SUCCESS = '.'
|
10
|
-
FAILURE = 'F'
|
11
|
-
|
12
|
-
# Run printer
|
13
|
-
#
|
14
|
-
# @return [undefined]
|
15
|
-
def run
|
16
|
-
char(success? ? SUCCESS : FAILURE)
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def char(char)
|
22
|
-
output.write(colorize(status_color, char))
|
23
|
-
end
|
24
|
-
end # MutationProgressResult
|
25
|
-
end # Printer
|
26
|
-
end # CLI
|
27
|
-
end # Reporter
|
28
|
-
end # Mutant
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Mutant
|
4
|
-
class Reporter
|
5
|
-
class CLI
|
6
|
-
class Printer
|
7
|
-
# Reporter for subject progress
|
8
|
-
class SubjectProgress < self
|
9
|
-
FORMAT = '(%02d/%02d) %3d%% - killtime: %0.02fs runtime: %0.02fs overhead: %0.02fs'
|
10
|
-
|
11
|
-
delegate(
|
12
|
-
:tests,
|
13
|
-
:subject,
|
14
|
-
:coverage,
|
15
|
-
:runtime,
|
16
|
-
:amount_mutations_killed,
|
17
|
-
:amount_mutations,
|
18
|
-
:amount_mutation_results,
|
19
|
-
:killtime,
|
20
|
-
:overhead
|
21
|
-
)
|
22
|
-
|
23
|
-
# Run printer
|
24
|
-
#
|
25
|
-
# @return [undefined]
|
26
|
-
def run
|
27
|
-
puts("#{subject.identification} mutations: #{amount_mutations}")
|
28
|
-
print_mutation_results
|
29
|
-
print_progress_bar_finish
|
30
|
-
print_stats
|
31
|
-
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def print_stats
|
36
|
-
status(
|
37
|
-
FORMAT,
|
38
|
-
amount_mutations_killed,
|
39
|
-
amount_mutations,
|
40
|
-
coverage * 100,
|
41
|
-
killtime,
|
42
|
-
runtime,
|
43
|
-
overhead
|
44
|
-
)
|
45
|
-
end
|
46
|
-
|
47
|
-
def print_progress_bar_finish
|
48
|
-
puts(nil) unless amount_mutation_results.zero?
|
49
|
-
end
|
50
|
-
|
51
|
-
def print_mutation_results
|
52
|
-
visit_collection(MutationProgressResult, object.mutation_results)
|
53
|
-
end
|
54
|
-
end # SubjectProgress
|
55
|
-
end # Printer
|
56
|
-
end # CLI
|
57
|
-
end # Reporter
|
58
|
-
end # Mutant
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Mutant
|
4
|
-
class Reporter
|
5
|
-
class CLI
|
6
|
-
class Printer
|
7
|
-
# Test result reporter
|
8
|
-
class TestResult < self
|
9
|
-
|
10
|
-
delegate :tests, :runtime
|
11
|
-
|
12
|
-
STATUS_FORMAT = '- %d @ runtime: %s'
|
13
|
-
OUTPUT_HEADER = 'Test Output:'
|
14
|
-
TEST_FORMAT = ' - %s'
|
15
|
-
|
16
|
-
# Run test result reporter
|
17
|
-
#
|
18
|
-
# @return [undefined]
|
19
|
-
def run
|
20
|
-
info(STATUS_FORMAT, tests.length, runtime)
|
21
|
-
tests.each do |test|
|
22
|
-
info(TEST_FORMAT, test.identification)
|
23
|
-
end
|
24
|
-
puts(OUTPUT_HEADER)
|
25
|
-
puts(object.output)
|
26
|
-
end
|
27
|
-
|
28
|
-
end # TestResult
|
29
|
-
end # Printer
|
30
|
-
end # CLI
|
31
|
-
end # Reporter
|
32
|
-
end # Mutant
|