Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions R/auto-test.R
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down
1 change: 0 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ reference:

- title: Run tests
contents:
- starts_with("auto_test")
- describe
- starts_with("test_")
- use_catch
Expand Down
23 changes: 10 additions & 13 deletions man/auto_test.Rd

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

23 changes: 0 additions & 23 deletions man/auto_test_package.Rd

This file was deleted.

Loading