Name Mode Size
.github 040000
R 040000
dev 040000
man 040000
pkgdown 040000
tests 040000
vignettes 040000
.Rbuildignore 100644 0 kb
.gitattributes 100644 0 kb
.gitignore 100644 0 kb
DESCRIPTION 100644 1 kb 100644 34 kb
NAMESPACE 100644 0 kb 100644 0 kb
README.Rmd 100644 6 kb 100644 5 kb
_pkgdown.yml 100644 0 kb
<!-- is generated from README.Rmd. Please edit that file --> # biocroxytest <a href=""><img src="man/figures/logo.png" align="right" height="138" alt="biocroxytest website" /></a> <!-- badges: start --> [![Lifecycle: experimental](]( [![R-CMD-check](]( [![Codecov test coverage](]( [![PRs Welcome](]( [![GitHub issues](]( [![GitHub pulls](]( <!-- badges: end --> The *[biocroxytest](* package is a novel tool that enhances the efficiency of test writing in R, particularly for Bioconductor software packages. It leverages the structure of *[roxygen2](* for test writing, which improves readability, code organization, and integrates seamlessly with package documentation. In Bioconductor, daily tests are run as part of the nightly builds, with a maximum limit of 40 minutes per package. For tests that exceed this limit, developers can set up “long tests” and add their package to the Bioconductor Long Tests builds. However, traditionally separating tests and long tests can be cumbersome. *[biocroxytest](* addresses this issue by introducing a new roclet, `@longtests`, inspired by *[roxytest](*. This allows developers to document and store long tests directly within their *[roxygen2](* comments. By using the `@longtests` roclet, extensive tests are run and checked regularly without impacting the efficiency of the daily build process. The `@longtests` roclet provides a dedicated space for extensive tests, ensuring they are easily accessible and well-documented. This not only improves the package’s reliability but also its maintainability. Thus, *[biocroxytest](* contributes to the creation of robust, reliable, and efficient Bioconductor packages. ## Installation instructions Get the latest stable `R` release from [CRAN]( Then install `biocroxytest` from [Bioconductor]( using the following code: ``` r # Not yet on Bioconductor # if (!requireNamespace("BiocManager", quietly = TRUE)) { # install.packages("BiocManager") # } # # BiocManager::install("biocroxytest") ``` And the development version from [GitHub]( with: ``` r BiocManager::install("xec-cm/biocroxytest") ``` ## Example Here is how you can use *[biocroxytest](* to create a new package with long tests: To use the package in your own package you do not need to add any additional dependencies in your package’s DESCRIPTION file. Simply add the following lines to your package’s DESCRIPTION file (along with Suggests: testthat): Roxygen: list(roclets = c("namespace", "rd", "biocroxytest::longtests_roclet")) Then add `@longtests` to the roxygen comments of the functions you want to test. For example, if the file `R/functions.R` contains this code: ``` r #' A function to do x #' #' @param x A number #' #' @longtests #' expect_equal(foo(2), sqrt(2)) #' expect_error(foo("a string")) #' #' @return something foo <- function(x) { return(sqrt(x)) } #' A function to do y #' #' @param x Character vector #' @param y Character vector #' #' @longtests #' expect_equal(bar("A", "B"), paste("A", "B", sep = "/")) #' #' @export bar <- function(x, y) { paste0(x, "/", y) } ``` Then `roxygen2::roxygenise()` will generate (with the `longtests_roclet` roclet) the file `longtests/test-biocroxytest-tests-functions.R` with this content: ``` r # Generated by biocroxytest: do not edit by hand! # File R/functions.R: @longtests test_that("Function foo() @ L11", { expect_equal(foo(2), sqrt(2)) expect_error(foo("a string")) }) test_that("Function bar() @ L27", { expect_equal(bar("A", "B"), paste("A", "B", sep = "/")) }) ``` ## Contributing - If you think you have encountered a bug, please [submit an issue]( - Either way, learn how to create and share a [reprex]( (a minimal, reproducible example), to clearly communicate about your code. - Working on your first Pull Request? You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub]( ## Code of Conduct Please note that the *[biocroxytest](* project is released with a [Contributor Code of Conduct]( By contributing to this project, you agree to abide by its terms.