MutationReporter | R Documentation |
The 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.
test_reporter
Reporter to use for the testthat::test_dir function
out
Output destination for reporter messages
width
Width of the console in characters
unicode
Whether Unicode output is supported
crayon
Whether colored output is supported
rstudio
Whether running in RStudio
hyperlinks
Whether terminal hyperlinks are supported
current_file
Path of the file currently being mutated
current_mutator
Mutator currently being applied
plan
Complete mutation plan for the test run
results
List of mutation test results, indexed by file path
current_score
Current score of the mutation tests
new()
Initialize a new reporter
MutationReporter$new(test_reporter = "silent", file = stdout())
test_reporter
Reporter to use for the testthat::test_dir function
file
Output destination (default: stdout)
start_reporter()
Start reporter
MutationReporter$start_reporter(plan = NULL)
plan
The complete mutation plan
temp_dir
Path to the temporary directory for testing
start_file()
Start testing a file
MutationReporter$start_file(filename)
filename
Path to the file being mutated
start_mutator()
Start testing with a specific mutator
MutationReporter$start_mutator(mutator)
mutator
The mutator being applied
add_result()
Add a mutation test result
MutationReporter$add_result(plan, killed, survived, errors)
plan
Current testing plan. See plan()
.
killed
Whether the mutation was killed by tests
survived
Number of survived mutations
errors
Number of errors encountered
end_mutator()
End testing with current mutator
MutationReporter$end_mutator()
end_file()
End testing current file
MutationReporter$end_file()
end_reporter()
End reporter and show summary
MutationReporter$end_reporter()
get_score()
Get the current score
MutationReporter$get_score()
cat_tight()
Print a message to the output
MutationReporter$cat_tight(...)
...
Message to print
cat_line()
Print a message to the output
MutationReporter$cat_line(...)
...
Message to print
rule()
Print a message to the output with a rule
MutationReporter$rule(...)
...
Message to print
clone()
The objects of this class are cloneable with this method.
MutationReporter$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other MutationReporter:
ProgressMutationReporter
,
default_reporter()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.