diff --git a/R/auto-test.R b/R/auto-test.R index d45113580..4a714ba82 100644 --- a/R/auto-test.R +++ b/R/auto-test.R @@ -1,24 +1,18 @@ #' Watches code and tests for changes, rerunning tests as appropriate. #' +#' @description +#' `r lifecycle::badge("superseded")` +#' #' The idea behind `auto_test()` is that you just leave it running while #' you develop your code. Every time you save a file it will be automatically #' tested and you can easily see if your changes have caused any test -#' failures. +#' failures. #' #' The current strategy for rerunning tests is as follows: #' #' - if any code has changed, then those files are reloaded and all tests #' rerun #' - otherwise, each new or modified test is run -#' -#' In the future, `auto_test()` might implement one of the following more -#' intelligent alternatives: -#' -#' - Use codetools to build up dependency tree and then rerun tests only -#' when a dependency changes. -#' - Mimic ruby's autotest and rerun only failing tests until they pass, -#' and then rerun all tests. -# #' @seealso [auto_test_package()] #' @export #' @param code_path path to directory containing code @@ -27,7 +21,7 @@ #' @param env environment in which to execute test suite. #' @param hash Passed on to [watch()]. When FALSE, uses less accurate #' modification time stamps, but those are faster for large files. -#' @keywords debugging +#' @keywords internal auto_test <- function( code_path, test_path, @@ -67,15 +61,12 @@ auto_test <- function( watch(c(code_path, test_path), watcher, hash = hash) } -#' Watches a package for changes, rerunning tests as appropriate. -#' #' @param pkg path to package #' @export #' @param reporter test reporter to use #' @param hash Passed on to [watch()]. When FALSE, uses less accurate #' modification time stamps, but those are faster for large files. -#' @keywords debugging -#' @seealso [auto_test()] for details on how method works +#' @rdname auto_test auto_test_package <- function( pkg = ".", reporter = default_reporter(), diff --git a/_pkgdown.yml b/_pkgdown.yml index 62c47045e..a1c65c381 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -64,7 +64,6 @@ reference: - title: Run tests contents: - - starts_with("auto_test") - describe - starts_with("test_") - use_catch diff --git a/man/auto_test.Rd b/man/auto_test.Rd index 7b77df529..2656accfe 100644 --- a/man/auto_test.Rd +++ b/man/auto_test.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/auto-test.R \name{auto_test} \alias{auto_test} +\alias{auto_test_package} \title{Watches code and tests for changes, rerunning tests as appropriate.} \usage{ auto_test( @@ -11,6 +12,8 @@ auto_test( env = test_env(), hash = TRUE ) + +auto_test_package(pkg = ".", reporter = default_reporter(), hash = TRUE) } \arguments{ \item{code_path}{path to directory containing code} @@ -21,33 +24,27 @@ auto_test( \item{env}{environment in which to execute test suite.} -\item{hash}{Passed on to \code{\link[=watch]{watch()}}. When FALSE, uses less accurate +\item{hash}{Passed on to \code{\link[=watch]{watch()}}. When FALSE, uses less accurate modification time stamps, but those are faster for large files.} + +\item{pkg}{path to package} } \description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + The idea behind \code{auto_test()} is that you just leave it running while you develop your code. Every time you save a file it will be automatically tested and you can easily see if your changes have caused any test failures. -} -\details{ + The current strategy for rerunning tests is as follows: \itemize{ \item if any code has changed, then those files are reloaded and all tests rerun \item otherwise, each new or modified test is run } - -In the future, \code{auto_test()} might implement one of the following more -intelligent alternatives: -\itemize{ -\item Use codetools to build up dependency tree and then rerun tests only -when a dependency changes. -\item Mimic ruby's autotest and rerun only failing tests until they pass, -and then rerun all tests. -} } \seealso{ \code{\link[=auto_test_package]{auto_test_package()}} } -\keyword{debugging} +\keyword{internal} diff --git a/man/auto_test_package.Rd b/man/auto_test_package.Rd deleted file mode 100644 index f8bb20ee6..000000000 --- a/man/auto_test_package.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/auto-test.R -\name{auto_test_package} -\alias{auto_test_package} -\title{Watches a package for changes, rerunning tests as appropriate.} -\usage{ -auto_test_package(pkg = ".", reporter = default_reporter(), hash = TRUE) -} -\arguments{ -\item{pkg}{path to package} - -\item{reporter}{test reporter to use} - -\item{hash}{Passed on to \code{\link[=watch]{watch()}}. When FALSE, uses less accurate -modification time stamps, but those are faster for large files.} -} -\description{ -Watches a package for changes, rerunning tests as appropriate. -} -\seealso{ -\code{\link[=auto_test]{auto_test()}} for details on how method works -} -\keyword{debugging}