free_mutant/lib/mutant/runner/mutation.rb
Markus Schirp a618d82fb1 Push down test selection and add framework for output capture
This clearly is a WIP. We know have the reporter granularity to capture
per mutation test outputs + per mutation test selections.

This adds all infrastructure to address:

* #185 we know which tests are run in reporter
* #180 fine grained information available for the reporter
* #178 minitest project integration only needs to return an enumerable
  with metadata
* #174 We can now "see" all test, allowing to generate a default
  matcher.
* #158 Ability to steer test selection centralized for all integrations
* #125 We have the required objects in graph
* #96 We have finer granularity in reporter graph

Because we know signal more complex state from killforks to parent I
need to bring back killfork partent signalling, but this time with
sending complex data around (Test::Report). Should be easy with
Marshal.{dump,load} but my OSS time budget is exhausted for now.
2014-04-28 19:17:29 +00:00

70 lines
1.2 KiB
Ruby

# encoding: utf-8
module Mutant
class Runner
# Mutation runner
class Mutation < self
include Equalizer.new(:config, :mutation)
register Mutant::Mutation
# Return mutation
#
# @return [Mutation]
#
# @api private
#
attr_reader :mutation
# Return killers
#
# @return [Killer]
#
# @api private
#
attr_reader :killers
# Initialize object
#
# @param [Config] config
# @param [Mutation] mutation
#
# @return [undefined]
#
# @api private
#
def initialize(config, mutation)
@mutation = mutation
super(config)
end
# Test if mutation was handeled successfully
#
# @return [true]
# if successful
#
# @return [false]
# otherwise
#
# @api private
#
def success?
killers.any?(&:success?)
end
private
# Perform operation
#
# @return [undefined]
#
# @api private
#
def run
@killers = dispatch(config.strategy.killers(mutation))
report(self)
end
end # Mutation
end # Runner
end # Mutant