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
22 changes: 22 additions & 0 deletions R/test-compiled-code.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,28 @@ run_cpp_tests <- function(package) {
#' run_testthat_tests
#' }
#'
#' Assuming you have `useDynLib(<pkg>, .registration = TRUE)` in your package's
#' `NAMESPACE` file, this implies having routine registration code of the form:
#'
#' ```
#' // The definition for this function comes from the file 'src/test-runner.cpp',
#' // which is generated via `testthat::use_catch()`.
#' extern SEXP run_testthat_tests();
#'
#' static const R_CallMethodDef callMethods[] = {
#' // other .Call method definitions,
#' {"run_testthat_tests", (DL_FUNC) &run_testthat_tests, 0},
#' {NULL, NULL, 0}
#' };
#'
#' void R_init_<pkg>(DllInfo* dllInfo) {
#' R_registerRoutines(dllInfo, NULL, callMethods, NULL, NULL);
#' R_useDynamicSymbols(dllInfo, FALSE);
#' }
#' ```
#'
#' replacing `<pkg>` above with the name of your package, as appropriate.
#'
#' See [Controlling Visibility](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Controlling-visibility)
#' and [Registering Symbols](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-symbols)
#' in the **Writing R Extensions** manual for more information.
Expand Down
21 changes: 21 additions & 0 deletions man/use_catch.Rd

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

Loading