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) ⇒ Object
- .ignored ⇒ Object
- .killed ⇒ Object
- .no_coverage ⇒ Object
- .skipped(details = nil) ⇒ Object
- .survived ⇒ Object
- .timeout ⇒ Object
- .uncapturable ⇒ Object
Instance Method Summary collapse
- #error? ⇒ Boolean
- #ignored? ⇒ Boolean
- #killed? ⇒ Boolean
- #no_coverage? ⇒ Boolean
- #skipped? ⇒ Boolean
- #survived? ⇒ Boolean
- #timeout? ⇒ Boolean
- #uncapturable? ⇒ Boolean
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details
30 31 32 |
# File 'lib/mutineer/result.rb', line 30 def details @details end |
#id ⇒ Object (readonly)
Returns the value of attribute id
30 31 32 |
# File 'lib/mutineer/result.rb', line 30 def id @id end |
#mutation ⇒ Object (readonly)
Returns the value of attribute mutation
30 31 32 |
# File 'lib/mutineer/result.rb', line 30 def mutation @mutation end |
#status ⇒ Object (readonly)
Returns the value of attribute status
30 31 32 |
# File 'lib/mutineer/result.rb', line 30 def status @status end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject
30 31 32 |
# File 'lib/mutineer/result.rb', line 30 def subject @subject end |
Class Method Details
.error(details = nil) ⇒ Object
33 |
# File 'lib/mutineer/result.rb', line 33 def self.error(details = nil) = new(status: :error, details: details, subject: nil, mutation: nil, id: nil) |
.ignored ⇒ Object
38 |
# File 'lib/mutineer/result.rb', line 38 def self.ignored = new(status: :ignored, details: nil, subject: nil, mutation: nil, id: nil) |
.killed ⇒ Object
31 |
# File 'lib/mutineer/result.rb', line 31 def self.killed = new(status: :killed, details: nil, subject: nil, mutation: nil, id: nil) |
.no_coverage ⇒ Object
36 |
# File 'lib/mutineer/result.rb', line 36 def self.no_coverage = new(status: :no_coverage, details: nil, subject: nil, mutation: nil, id: nil) |
.skipped(details = nil) ⇒ Object
35 |
# File 'lib/mutineer/result.rb', line 35 def self.skipped(details = nil) = new(status: :skipped, details: details, subject: nil, mutation: nil, id: nil) |
.survived ⇒ Object
32 |
# File 'lib/mutineer/result.rb', line 32 def self.survived = new(status: :survived, details: nil, subject: nil, mutation: nil, id: nil) |
.timeout ⇒ Object
34 |
# File 'lib/mutineer/result.rb', line 34 def self.timeout = new(status: :timeout, details: nil, subject: nil, mutation: nil, id: nil) |
.uncapturable ⇒ Object
37 |
# File 'lib/mutineer/result.rb', line 37 def self.uncapturable = new(status: :uncapturable, details: nil, subject: nil, mutation: nil, id: nil) |
Instance Method Details
#error? ⇒ Boolean
42 |
# File 'lib/mutineer/result.rb', line 42 def error? = status == :error |
#ignored? ⇒ Boolean
47 |
# File 'lib/mutineer/result.rb', line 47 def ignored? = status == :ignored |
#killed? ⇒ Boolean
40 |
# File 'lib/mutineer/result.rb', line 40 def killed? = status == :killed |
#no_coverage? ⇒ Boolean
45 |
# File 'lib/mutineer/result.rb', line 45 def no_coverage? = status == :no_coverage |
#skipped? ⇒ Boolean
44 |
# File 'lib/mutineer/result.rb', line 44 def skipped? = status == :skipped |
#survived? ⇒ Boolean
41 |
# File 'lib/mutineer/result.rb', line 41 def survived? = status == :survived |
#timeout? ⇒ Boolean
43 |
# File 'lib/mutineer/result.rb', line 43 def timeout? = status == :timeout |
#uncapturable? ⇒ Boolean
46 |
# File 'lib/mutineer/result.rb', line 46 def uncapturable? = status == :uncapturable |