|
1 | 1 | #' Watches code and tests for changes, rerunning tests as appropriate. |
2 | 2 | #' |
| 3 | +#' @description |
| 4 | +#' `r lifecycle::badge("superseded")` |
| 5 | +#' |
3 | 6 | #' The idea behind `auto_test()` is that you just leave it running while |
4 | 7 | #' you develop your code. Every time you save a file it will be automatically |
5 | 8 | #' tested and you can easily see if your changes have caused any test |
6 | | -#' failures. |
| 9 | +#' failures. |
7 | 10 | #' |
8 | 11 | #' The current strategy for rerunning tests is as follows: |
9 | 12 | #' |
10 | 13 | #' - if any code has changed, then those files are reloaded and all tests |
11 | 14 | #' rerun |
12 | 15 | #' - otherwise, each new or modified test is run |
13 | | -#' |
14 | | -#' In the future, `auto_test()` might implement one of the following more |
15 | | -#' intelligent alternatives: |
16 | | -#' |
17 | | -#' - Use codetools to build up dependency tree and then rerun tests only |
18 | | -#' when a dependency changes. |
19 | | -#' - Mimic ruby's autotest and rerun only failing tests until they pass, |
20 | | -#' and then rerun all tests. |
21 | | -# |
22 | 16 | #' @seealso [auto_test_package()] |
23 | 17 | #' @export |
24 | 18 | #' @param code_path path to directory containing code |
|
27 | 21 | #' @param env environment in which to execute test suite. |
28 | 22 | #' @param hash Passed on to [watch()]. When FALSE, uses less accurate |
29 | 23 | #' modification time stamps, but those are faster for large files. |
30 | | -#' @keywords debugging |
| 24 | +#' @keywords internal |
31 | 25 | auto_test <- function( |
32 | 26 | code_path, |
33 | 27 | test_path, |
@@ -67,15 +61,12 @@ auto_test <- function( |
67 | 61 | watch(c(code_path, test_path), watcher, hash = hash) |
68 | 62 | } |
69 | 63 |
|
70 | | -#' Watches a package for changes, rerunning tests as appropriate. |
71 | | -#' |
72 | 64 | #' @param pkg path to package |
73 | 65 | #' @export |
74 | 66 | #' @param reporter test reporter to use |
75 | 67 | #' @param hash Passed on to [watch()]. When FALSE, uses less accurate |
76 | 68 | #' modification time stamps, but those are faster for large files. |
77 | | -#' @keywords debugging |
78 | | -#' @seealso [auto_test()] for details on how method works |
| 69 | +#' @rdname auto_test |
79 | 70 | auto_test_package <- function( |
80 | 71 | pkg = ".", |
81 | 72 | reporter = default_reporter(), |
|
0 commit comments