Class: Mutineer::Result
- Inherits:
-
Data
- Object
- Data
- Mutineer::Result
- Defined in:
- lib/mutineer/result.rb
Overview
Immutable outcome of running one mutant. Seven distinct states:
killed — a test failed/errored, so the mutation was caught.
survived — every test passed, so the mutation went undetected.
error — the child crashed (unhandled exception): exit status 2.
timeout — the parent SIGKILLed a child that overran its wall clock.
skipped — the mutated source failed to re-parse (invalid); no fork.
no_coverage — no test exercises the mutated line; not run, not scored.
uncapturable — the line's would-be covering test errored during capture
(#9), so coverage was lost. Excluded from the
denominator exactly like no_coverage, but reported
separately: it signals a broken harness (a test that
failed to run), not a genuine coverage gap.
ignored — a known-equivalent mutant the user suppressed (#10), via
an inline `# mutineer:disable-line` comment or a
`.mutineer.yml` `ignore:` id. A pre-fork classification
(never run); excluded from the denominator so a strong
file can reach 100%.
error and skipped are deliberately distinct: skipped is a pre-fork
validity failure (counted separately by the reporter), error is a runtime
crash. Never conflate them via details string parsing. no_coverage and
uncapturable are pre-fork selection results (M3/#9): both excluded from
the score denominator.
subject, mutation, and id are nil when the Result is built by
Isolation/Runner (which only know the outcome); the orchestrator attaches
them afterwards via result.with(subject:, mutation:, id:) so the Reporter
can render survivor diffs and emit the stable id. id is the content-based
MutantId (#10).
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#mutation ⇒ Object
readonly
Returns the value of attribute mutation.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Class Method Summary collapse
-
.error(details = nil) ⇒ Mutineer::Result
Builds an error result.
-
.ignored ⇒ Mutineer::Result
Builds an ignored result.
-
.killed ⇒ Mutineer::Result
Builds a killed result.
-
.no_coverage ⇒ Mutineer::Result
Builds a no_coverage result.
-
.skipped(details = nil) ⇒ Mutineer::Result
Builds a skipped result.
-
.survived ⇒ Mutineer::Result
Builds a survived result.
-
.timeout ⇒ Mutineer::Result
Builds a timeout result.
-
.uncapturable ⇒ Mutineer::Result
Builds an uncapturable result.
Instance Method Summary collapse
-
#error? ⇒ Boolean
True when the status is error.
-
#ignored? ⇒ Boolean
True when the status is ignored.
-
#killed? ⇒ Boolean
True when the status is killed.
-
#no_coverage? ⇒ Boolean
True when the status is no_coverage.
-
#skipped? ⇒ Boolean
True when the status is skipped.
-
#survived? ⇒ Boolean
True when the status is survived.
-
#timeout? ⇒ Boolean
True when the status is timeout.
-
#uncapturable? ⇒ Boolean
True when the status is uncapturable.
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details
33 34 35 |
# File 'lib/mutineer/result.rb', line 33 def details @details end |
#id ⇒ Object (readonly)
Returns the value of attribute id
33 34 35 |
# File 'lib/mutineer/result.rb', line 33 def id @id end |
#mutation ⇒ Object (readonly)
Returns the value of attribute mutation
33 34 35 |
# File 'lib/mutineer/result.rb', line 33 def mutation @mutation end |
#status ⇒ Object (readonly)
Returns the value of attribute status
33 34 35 |
# File 'lib/mutineer/result.rb', line 33 def status @status end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject
33 34 35 |
# File 'lib/mutineer/result.rb', line 33 def subject @subject end |
Class Method Details
.error(details = nil) ⇒ Mutineer::Result
Builds an error result.
48 |
# File 'lib/mutineer/result.rb', line 48 def self.error(details = nil) = new(status: :error, details: details, subject: nil, mutation: nil, id: nil) |
.ignored ⇒ Mutineer::Result
Builds an ignored result.
74 |
# File 'lib/mutineer/result.rb', line 74 def self.ignored = new(status: :ignored, details: nil, subject: nil, mutation: nil, id: nil) |
.killed ⇒ Mutineer::Result
Builds a killed result.
37 |
# File 'lib/mutineer/result.rb', line 37 def self.killed = new(status: :killed, details: nil, subject: nil, mutation: nil, id: nil) |
.no_coverage ⇒ Mutineer::Result
Builds a no_coverage result.
64 |
# File 'lib/mutineer/result.rb', line 64 def self.no_coverage = new(status: :no_coverage, details: nil, subject: nil, mutation: nil, id: nil) |
.skipped(details = nil) ⇒ Mutineer::Result
Builds a skipped result.
59 |
# File 'lib/mutineer/result.rb', line 59 def self.skipped(details = nil) = new(status: :skipped, details: details, subject: nil, mutation: nil, id: nil) |
.survived ⇒ Mutineer::Result
Builds a survived result.
42 |
# File 'lib/mutineer/result.rb', line 42 def self.survived = new(status: :survived, details: nil, subject: nil, mutation: nil, id: nil) |
.timeout ⇒ Mutineer::Result
Builds a timeout result.
53 |
# File 'lib/mutineer/result.rb', line 53 def self.timeout = new(status: :timeout, details: nil, subject: nil, mutation: nil, id: nil) |
.uncapturable ⇒ Mutineer::Result
Builds an uncapturable result.
69 |
# File 'lib/mutineer/result.rb', line 69 def self.uncapturable = new(status: :uncapturable, details: nil, subject: nil, mutation: nil, id: nil) |
Instance Method Details
#error? ⇒ Boolean
Returns true when the status is error.
81 82 |
# File 'lib/mutineer/result.rb', line 81 def error? = status == :error # @return [Boolean] true when the status is timeout. |
#ignored? ⇒ Boolean
Returns true when the status is ignored.
91 |
# File 'lib/mutineer/result.rb', line 91 def ignored? = status == :ignored |
#killed? ⇒ Boolean
Returns true when the status is killed.
77 78 |
# File 'lib/mutineer/result.rb', line 77 def killed? = status == :killed # @return [Boolean] true when the status is survived. |
#no_coverage? ⇒ Boolean
Returns true when the status is no_coverage.
87 88 |
# File 'lib/mutineer/result.rb', line 87 def no_coverage? = status == :no_coverage # @return [Boolean] true when the status is uncapturable. |
#skipped? ⇒ Boolean
Returns true when the status is skipped.
85 86 |
# File 'lib/mutineer/result.rb', line 85 def skipped? = status == :skipped # @return [Boolean] true when the status is no_coverage. |
#survived? ⇒ Boolean
Returns true when the status is survived.
79 80 |
# File 'lib/mutineer/result.rb', line 79 def survived? = status == :survived # @return [Boolean] true when the status is error. |
#timeout? ⇒ Boolean
Returns true when the status is timeout.
83 84 |
# File 'lib/mutineer/result.rb', line 83 def timeout? = status == :timeout # @return [Boolean] true when the status is skipped. |
#uncapturable? ⇒ Boolean
Returns true when the status is uncapturable.
89 90 |
# File 'lib/mutineer/result.rb', line 89 def uncapturable? = status == :uncapturable # @return [Boolean] true when the status is ignored. |