Add reporting for used tests to kill mutations on a given subject

This commit is contained in:
Markus Schirp 2014-05-23 01:47:31 +00:00
parent b6a1eb4632
commit 23b1d6c8bb
4 changed files with 27 additions and 1 deletions

View file

@ -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

View file

@ -4,6 +4,8 @@ module Mutant
class Test < Mutant::Test
include Concord.new(:strategy, :example_group)
PREFIX = :rspec
# Return subject identification
#
# @return [String]

View file

@ -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

View file

@ -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.