Class: Evilution::Runner::MutationExecutor::Strategy::Sequential Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/runner/mutation_executor/strategy/sequential.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(runner:, pipeline:, notifier:) ⇒ Sequential

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Sequential.



6
7
8
9
10
# File 'lib/evilution/runner/mutation_executor/strategy/sequential.rb', line 6

def initialize(runner:, pipeline:, notifier:)
  @runner = runner
  @pipeline = pipeline
  @notifier = notifier
end

Instance Method Details

#call(mutations, baseline_result:, integration:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/evilution/runner/mutation_executor/strategy/sequential.rb', line 12

def call(mutations, baseline_result:, integration:)
  @notifier.start(mutations.length)
  results = []
  truncated = false

  mutations.each_with_index do |mutation, index|
    result = @runner.call(mutation, integration: integration)
    mutation.strip_sources!
    result = @pipeline.call(result, baseline_result: baseline_result)
    results << result

    if @notifier.notify(result, index + 1) == :truncate
      truncated = true
      break
    end
  end

  @notifier.finish
  Evilution::Runner::MutationExecutor::ExecutionResult.new(results: results, truncated: truncated)
end