Class: Evilution::Runner::MutationExecutor::ResultNotifier Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/runner/mutation_executor/result_notifier.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 Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, diagnostics:, on_result:) ⇒ ResultNotifier

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



7
8
9
10
11
12
13
# File 'lib/evilution/runner/mutation_executor/result_notifier.rb', line 7

def initialize(config, diagnostics:, on_result:)
  @config = config
  @diagnostics = diagnostics
  @on_result = on_result
  @survived_count = 0
  @progress_bar = nil
end

Instance Attribute Details

#survived_countObject (readonly)

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.



15
16
17
# File 'lib/evilution/runner/mutation_executor/result_notifier.rb', line 15

def survived_count
  @survived_count
end

Instance Method Details

#finishObject

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.



31
32
33
# File 'lib/evilution/runner/mutation_executor/result_notifier.rb', line 31

def finish
  @progress_bar.finish if @progress_bar
end

#notify(result, index) ⇒ 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.



22
23
24
25
26
27
28
29
# File 'lib/evilution/runner/mutation_executor/result_notifier.rb', line 22

def notify(result, index)
  @on_result.call(result) if @on_result
  @progress_bar.tick(status: result.status) if @progress_bar
  @diagnostics.log_progress(index, result.status)
  @diagnostics.log_mutation_diagnostics(result)
  @survived_count += 1 if result.survived?
  truncate? ? :truncate : :continue
end

#start(total) ⇒ 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.



17
18
19
20
# File 'lib/evilution/runner/mutation_executor/result_notifier.rb', line 17

def start(total)
  @survived_count = 0
  @progress_bar = build_progress_bar(total)
end