ProgressMutationReporter {muttest} | R Documentation |
Progress Reporter for Mutation Testing
Description
A reporter that displays a progress indicator for mutation tests. It provides real-time feedback on which mutants are being tested and whether they were killed by tests.
Super class
muttest::MutationReporter
-> ProgressMutationReporter
Public fields
start_time
Time when testing started (for duration calculation)
min_time
Minimum test duration to display timing information
col_config
List of column configuration for report formatting
Methods
Public methods
Inherited methods
Method format_column()
Format a column with specified padding and width
Usage
ProgressMutationReporter$format_column(text, col_name, colorize = NULL)
Arguments
text
Text to format
col_name
Column name to use configuration from
colorize
Optional function to color the text
Method fmt_h()
Format the header of the report
Usage
ProgressMutationReporter$fmt_h()
Method fmt_r()
Format a row of the report
Usage
ProgressMutationReporter$fmt_r(status, k, s, e, t, score, mutator, file)
Arguments
status
Status symbol (e.g., tick or cross)
k
Number of killed mutations
s
Number of survived mutations
e
Number of errors
t
Total number of mutations
score
Score percentage
mutator
The mutator used
file
The file being tested
Returns
Formatted row string
Method new()
Initialize a new progress reporter
Usage
ProgressMutationReporter$new( test_reporter = "silent", min_time = 1, file = stdout() )
Arguments
test_reporter
Reporter to use for testthat::test_dir
min_time
Minimum time to show elapsed time (default: 1s)
file
Output destination (default: stdout)
Method start_reporter()
Start reporter
Usage
ProgressMutationReporter$start_reporter(plan = NULL)
Arguments
plan
The complete mutation plan
Method add_result()
Add a mutation test result
Usage
ProgressMutationReporter$add_result(plan, killed, survived, errors)
Arguments
plan
Current testing plan. See
plan()
.killed
Whether the mutation was killed by tests
survived
Number of survived mutations
errors
Number of errors encountered
Method update()
Update status spinner (for long-running operations)
Usage
ProgressMutationReporter$update(force = FALSE)
Arguments
force
Force update even if interval hasn't elapsed
Method end_file()
End testing current file
Usage
ProgressMutationReporter$end_file()
Method cr()
Carriage return if dynamic, newline otherwise
Usage
ProgressMutationReporter$cr()
Method end_reporter()
End reporter with detailed summary
Usage
ProgressMutationReporter$end_reporter()
Method clone()
The objects of this class are cloneable with this method.
Usage
ProgressMutationReporter$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
See Also
Other MutationReporter:
MutationReporter
,
default_reporter()