Add reporting for used tests to kill mutations on a given subject
This commit is contained in:
parent
b6a1eb4632
commit
23b1d6c8bb
4 changed files with 27 additions and 1 deletions
|
@ -19,6 +19,9 @@ module Mutant
|
|||
#
|
||||
def run
|
||||
status(subject.identification)
|
||||
object.tests.each do |test|
|
||||
puts("- #{test.identification}")
|
||||
end
|
||||
object.failed_mutations.each(&method(:visit))
|
||||
self
|
||||
end
|
||||
|
|
|
@ -4,6 +4,8 @@ module Mutant
|
|||
class Test < Mutant::Test
|
||||
include Concord.new(:strategy, :example_group)
|
||||
|
||||
PREFIX = :rspec
|
||||
|
||||
# Return subject identification
|
||||
#
|
||||
# @return [String]
|
||||
|
|
|
@ -63,6 +63,17 @@ module Mutant
|
|||
failed_mutations.empty?
|
||||
end
|
||||
|
||||
# Return tests used to kill mutations on this subject
|
||||
#
|
||||
# @return [Enumerable<Test>]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def tests
|
||||
config.strategy.tests(subject)
|
||||
end
|
||||
memoize :tests
|
||||
|
||||
private
|
||||
|
||||
# Perform operation
|
||||
|
@ -73,7 +84,6 @@ module Mutant
|
|||
#
|
||||
def run
|
||||
progress(subject)
|
||||
tests = config.strategy.tests(subject)
|
||||
@mutations = visit_collection(subject.mutations, tests)
|
||||
progress(self)
|
||||
end
|
||||
|
|
|
@ -61,6 +61,17 @@ module Mutant
|
|||
#
|
||||
abstract_method :run
|
||||
|
||||
# Return test identification
|
||||
#
|
||||
# @return [String]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def identification
|
||||
"#{self.class::PREFIX}:#{subject_identification}"
|
||||
end
|
||||
memoize :identification
|
||||
|
||||
# Return subject identification
|
||||
#
|
||||
# This method is used for current mutants primitive test selection.
|
||||
|
|
Loading…
Add table
Reference in a new issue