Skip to content

Commit

Permalink
Merge pull request #354 from krlmlr/max-reports
Browse files Browse the repository at this point in the history
Limit number of reports printed
  • Loading branch information
hadley committed Feb 18, 2016
2 parents b32ddfa + 8e7add8 commit 3a86a5e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# testthat 0.11.0.9000

* New option `testthat.summary.max_reports` that limits the number of reports printed by the summary reporter, default: 15 (@krlmlr, #354).

* Fix failure message for `throws_error` in case where no error is raised (@nealrichardson, #342).

* Added [Catch](https://github.com/philsquared/Catch) for unit testing of C++ code.
Expand Down
2 changes: 1 addition & 1 deletion R/reporter-summary.r
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SummaryReporter <- setRefClass("SummaryReporter", contains = "Reporter",
"show_praise" = "logical"),

methods = list(
initialize = function(max_reports = Inf, ...) {
initialize = function(max_reports = getOption("testthat.summary.max_reports", 15L), ...) {
max_reports <<- max_reports
show_praise <<- TRUE
callSuper(...)
Expand Down
7 changes: 7 additions & 0 deletions R/test-that.r
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ test_code <- function(description, code, env) {
#' testthat is a new testing framework for R that is easy learn and use,
#' and integrates with your existing workflow.
#'
#' @section Options:
#' \code{testthat.use_colours}: Should the output be coloured? (Default:
#' \code{TRUE}).
#'
#' \code{testthat.summary.max_reports}: The maximum number of detailed test
#' reports printed for the summary reporter (default: 15).
#'
#' @docType package
#' @name testthat
#' @references Wickham, H (2011). testthat: Get Started with Testing.
Expand Down
8 changes: 8 additions & 0 deletions man/testthat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3a86a5e

Please sign in to comment.