1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#' Test reporter: RStudio
#'
#' This reporter is designed for output to RStudio. It produces results in
#' any easily parsed form.
#'
#' @export
#' @family reporters
RStudioReporter <- R6::R6Class("RStudioReporter",
inherit = Reporter,
public = list(
initialize = function(...) {
self$capabilities$parallel_support <- TRUE
super$initialize(...)
},
add_result = function(context, test, result) {
if (expectation_success(result)) {
return()
}
loc <- expectation_location(result)
status <- expectation_type(result)
first_line <- strsplit(result$message, "\n")[[1]][1]
self$cat_line(loc, " [", status, "] ", test, ". ", first_line)
}
)
)
|