Class: Evilution::Result::MutationResult Private
- Inherits:
-
Object
- Object
- Evilution::Result::MutationResult
- Defined in:
- lib/evilution/result/mutation_result.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.
Constant Summary collapse
- STATUSES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%i[killed survived timeout error neutral equivalent unresolved unparseable].freeze
Instance Attribute Summary collapse
- #duration ⇒ Object readonly private
- #error ⇒ Object readonly private
- #killing_test ⇒ Object readonly private
- #memory ⇒ Object readonly private
- #mutation ⇒ Object readonly private
- #status ⇒ Object readonly private
- #test_command ⇒ Object readonly private
Instance Method Summary collapse
-
#child_rss_kb ⇒ Object
private
Positive type checks, not nil checks.
- #equivalent? ⇒ Boolean private
- #error? ⇒ Boolean private
- #error_backtrace ⇒ Object private
- #error_class ⇒ Object private
- #error_message ⇒ Object private
-
#initialize(mutation:, status:, duration: 0.0, killing_test: nil, test_command: nil, memory: nil, error: nil) ⇒ MutationResult
constructor
private
A new instance of MutationResult.
- #killed? ⇒ Boolean private
- #memory_delta_kb ⇒ Object private
- #neutral? ⇒ Boolean private
- #parent_rss_kb ⇒ Object private
- #survived? ⇒ Boolean private
- #timeout? ⇒ Boolean private
- #unparseable? ⇒ Boolean private
- #unresolved? ⇒ Boolean private
Constructor Details
#initialize(mutation:, status:, duration: 0.0, killing_test: nil, test_command: nil, memory: nil, error: nil) ⇒ MutationResult
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 MutationResult.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/evilution/result/mutation_result.rb', line 12 def initialize(mutation:, status:, duration: 0.0, killing_test: nil, test_command: nil, memory: nil, error: nil) raise ArgumentError, "invalid status: #{status}" unless STATUSES.include?(status) @mutation = mutation @status = status @duration = duration @killing_test = killing_test @test_command = test_command @memory = memory @error = error freeze end |
Instance Attribute Details
#duration ⇒ Object (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.
10 11 12 |
# File 'lib/evilution/result/mutation_result.rb', line 10 def duration @duration end |
#error ⇒ Object (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.
10 11 12 |
# File 'lib/evilution/result/mutation_result.rb', line 10 def error @error end |
#killing_test ⇒ Object (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.
10 11 12 |
# File 'lib/evilution/result/mutation_result.rb', line 10 def killing_test @killing_test end |
#memory ⇒ Object (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.
10 11 12 |
# File 'lib/evilution/result/mutation_result.rb', line 10 def memory @memory end |
#mutation ⇒ Object (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.
10 11 12 |
# File 'lib/evilution/result/mutation_result.rb', line 10 def mutation @mutation end |
#status ⇒ Object (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.
10 11 12 |
# File 'lib/evilution/result/mutation_result.rb', line 10 def status @status end |
#test_command ⇒ Object (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.
10 11 12 |
# File 'lib/evilution/result/mutation_result.rb', line 10 def test_command @test_command end |
Instance Method Details
#child_rss_kb ⇒ 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.
Positive type checks, not nil checks. EV-s5br / GH #1174: the
nil_replacement mutator can swap a nil default into false (or some other
non-typed value), and nil? then returns false, sending a missing method
to the wrong receiver and crashing the parent worker. Asking the field
explicitly whether it is the expected struct keeps the parent process
alive and lets the mutation count as a measured (errored) result.
32 33 34 |
# File 'lib/evilution/result/mutation_result.rb', line 32 def child_rss_kb @memory.is_a?(Evilution::Result::MemoryStats) ? @memory.child_rss_kb : nil end |
#equivalent? ⇒ 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.
76 77 78 |
# File 'lib/evilution/result/mutation_result.rb', line 76 def equivalent? status == :equivalent end |
#error? ⇒ 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.
68 69 70 |
# File 'lib/evilution/result/mutation_result.rb', line 68 def error? status == :error end |
#error_backtrace ⇒ 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.
52 53 54 |
# File 'lib/evilution/result/mutation_result.rb', line 52 def error_backtrace @error.is_a?(Evilution::Result::ErrorInfo) ? @error.backtrace : nil end |
#error_class ⇒ 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.
48 49 50 |
# File 'lib/evilution/result/mutation_result.rb', line 48 def error_class @error.is_a?(Evilution::Result::ErrorInfo) ? @error.klass : nil end |
#error_message ⇒ 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.
44 45 46 |
# File 'lib/evilution/result/mutation_result.rb', line 44 def @error.is_a?(Evilution::Result::ErrorInfo) ? @error. : nil end |
#killed? ⇒ 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.
56 57 58 |
# File 'lib/evilution/result/mutation_result.rb', line 56 def killed? status == :killed end |
#memory_delta_kb ⇒ 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.
36 37 38 |
# File 'lib/evilution/result/mutation_result.rb', line 36 def memory_delta_kb @memory.is_a?(Evilution::Result::MemoryStats) ? @memory.memory_delta_kb : nil end |
#neutral? ⇒ 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.
72 73 74 |
# File 'lib/evilution/result/mutation_result.rb', line 72 def neutral? status == :neutral end |
#parent_rss_kb ⇒ 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.
40 41 42 |
# File 'lib/evilution/result/mutation_result.rb', line 40 def parent_rss_kb @memory.is_a?(Evilution::Result::MemoryStats) ? @memory.parent_rss_kb : nil end |
#survived? ⇒ 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.
60 61 62 |
# File 'lib/evilution/result/mutation_result.rb', line 60 def survived? status == :survived end |
#timeout? ⇒ 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.
64 65 66 |
# File 'lib/evilution/result/mutation_result.rb', line 64 def timeout? status == :timeout end |
#unparseable? ⇒ 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.
84 85 86 |
# File 'lib/evilution/result/mutation_result.rb', line 84 def unparseable? status == :unparseable end |
#unresolved? ⇒ 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.
80 81 82 |
# File 'lib/evilution/result/mutation_result.rb', line 80 def unresolved? status == :unresolved end |