Skip to content

Commit 4c87fea

Browse files
committed
first stab at print method
1 parent e2cd779 commit 4c87fea

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

R/reporter-project.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ ProjectReporter <- R6::R6Class("ProjectReporter", inherit = testthat::ListReport
5757
message = message,
5858
success = success,
5959
outcome = outcome)
60+
},
61+
print = function() {
62+
end_report <- self$end_reporter()
63+
summary <- end_report$summary
64+
tests <- do.call(rbind, lapply(end_report$tests, data.frame, stringsAsFactors=FALSE))
65+
tests <- tests[ ! tests$success, ]
66+
tests <- end_report$tests
67+
cat("Tests:", summary$tests, ", Failures:", summary$failures, ", Errors: ", summary$errors, sep = "")
68+
cat("\n")
69+
for(i in seq_along(tests)) {
70+
test <- tests[[i]]
71+
if(test$success) next
72+
cat(">", test$outcome, "::", test$name)
73+
cat("\n")
74+
cat( test$message, "\n---\n")
75+
}
76+
invisible(self)
6077
}
6178
),
6279
private = list(

0 commit comments

Comments
 (0)