
Reporter for Mutation Testing
MutationReporter.RdThe job of a mutation reporter is to aggregate and display the results of mutation tests. It tracks each mutation attempt, reporting on whether the tests killed the mutation or the mutation survived.
See also
Other MutationReporter:
ProgressMutationReporter,
default_reporter()
Public fields
test_reporterReporter to use for the testthat::test_dir function
outOutput destination for reporter messages
widthWidth of the console in characters
unicodeWhether Unicode output is supported
crayonWhether colored output is supported
rstudioWhether running in RStudio
hyperlinksWhether terminal hyperlinks are supported
current_filePath of the file currently being mutated
current_mutatorMutator currently being applied
planComplete mutation plan for the test run
resultsList of mutation test results, indexed by file path
current_scoreCurrent score of the mutation tests
error_messagesList of error messages from failed mutant runs
Methods
Method new()
Initialize a new reporter
Usage
MutationReporter$new(test_reporter = "silent", file = stdout())Method add_result()
Add a mutation test result
Usage
MutationReporter$add_result(
plan,
killed,
survived,
errors,
error = NULL,
original_code = NULL,
mutated_code = NULL
)Arguments
planCurrent testing plan. See
muttest_plan().killedWhether the mutation was killed by tests
survivedNumber of survived mutations
errorsNumber of errors encountered
errorOptional error condition from a failed run
original_codeOriginal source lines before mutation
mutated_codeMutated source lines
Method update()
Update status (no-op in base class)