41d9700473
* Nuke around 800 lock * Honor LSP with not anymore squeezing something non LSP compatible in the same inheritance tree. * Separate running from result tree. * Clean up kill logic and early exits on already dead mutations. * Fix #runnin? smell for reporters. * Decouple config object from VM state. Makes it serializable to enable config loading. * Fix sequence of global VM events to match PRIOR rspec infects VM with gazillions of classes / modules. Thix fixes a startup speed degeneration. * Various fixes to enhance determinism. * Replace some unneded manual double dispatch with single manual dispatch for reporter / runners.
58 lines
1.1 KiB
Ruby
58 lines
1.1 KiB
Ruby
module Mutant
|
|
class Reporter
|
|
# Reporter to trace report calls, used as a spec adapter
|
|
class Trace
|
|
include Adamantium::Mutable, Anima.new(:progress_calls, :report_calls, :warn_calls)
|
|
|
|
# Return new trace reporter
|
|
#
|
|
# @return [Trace]
|
|
#
|
|
# @api private
|
|
#
|
|
def self.new
|
|
super(Hash[anima.attribute_names.map { |name| [name, []] }])
|
|
end
|
|
|
|
# Warn with message
|
|
#
|
|
# @param [String] message
|
|
#
|
|
# @return [self]
|
|
#
|
|
# @api private
|
|
#
|
|
def warn(message)
|
|
warn_calls << message
|
|
self
|
|
end
|
|
|
|
# Report object
|
|
#
|
|
# @param [Object] object
|
|
#
|
|
# @return [self]
|
|
#
|
|
# @api private
|
|
#
|
|
def report(object)
|
|
report_calls << object
|
|
self
|
|
end
|
|
|
|
# Report new progress on object
|
|
#
|
|
# @param [Object] object
|
|
#
|
|
# @return [self]
|
|
#
|
|
# @api private
|
|
#
|
|
def progress(object)
|
|
progress_calls << object
|
|
self
|
|
end
|
|
|
|
end # Tracker
|
|
end # reporter
|
|
end # Mutant
|