Class: Mutant::Mutation::Runner::Sink Private

Inherits:
Object
  • Object
show all
Includes:
Parallel::Sink
Defined in:
lib/mutant/mutation/runner/sink.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

#initializeundefined

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.

Initialize object



14
15
16
17
18
# File 'lib/mutant/mutation/runner/sink.rb', line 14

def initialize(*)
  super
  @start           = env.world.timer.now
  @subject_results = {}
end

Instance Method Details

#response(response) ⇒ self

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.

Handle mutation finish

rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength

Parameters:

Returns:

  • (self)


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/mutant/mutation/runner/sink.rb', line 45

def response(response)
  fail response.error if response.error

  mutation        = env.mutations.fetch(response.result.mutation_index)
  subject         = mutation.subject
  mutation_result = mutation_result(mutation, response.result)

  @subject_results[subject] = Result::Subject.new(
    amount_mutations:  subject.mutations.length,
    coverage_results:  previous_coverage_results(subject).dup << coverage_result(mutation_result),
    expression_syntax: subject.expression.syntax,
    identification:    subject.identification,
    node:              subject.node,
    source:            subject.source,
    source_path:       subject.source_path.to_s,
    tests:             env.selections.fetch(subject)
  )

  self
end

#statusResult::Env

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.

Runner status

Returns:



23
24
25
26
27
28
29
# File 'lib/mutant/mutation/runner/sink.rb', line 23

def status
  Result::Env.new(
    env:,
    runtime:         env.world.timer.now - @start,
    subject_results: @subject_results.values
  )
end

#stop?Boolean

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.

Test if scheduling stopped

Returns:

  • (Boolean)


34
35
36
# File 'lib/mutant/mutation/runner/sink.rb', line 34

def stop?
  status.stop?
end