Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
xec-cm committed Jan 17, 2024
1 parent 3570aa5 commit f6831ea
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 6 deletions.
17 changes: 13 additions & 4 deletions R/use_longtests.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@


#' Sets up overall longtests infrastructure
#'
#' Creates longtests/testthat directory and longtests/testthat.R file.
#' This function is used to set up the environment for running long tests. It
#' calls two helper functions: `setup_bboptions()` and `setup_longtetsts()`.
#'
#' @details The `use_longtests()` function is a wrapper function that calls
#' `setup_bboptions()` and `setup_longtetsts()`. The `setup_bboptions()`
#' function checks if the .BBSoptions file exists and creates it if it doesn't.
#' It then checks the contents of the .BBSoptions file and adds or modifies the
#' 'RunLongTests: TRUE' line as needed. The `setup_longtetsts()` function
#' creates a 'longtests/testthat' directory if it doesn't exist and copies the
#' 'tests/testthat.R' file into it. If the 'tests/testthat.R' file doesn't
#' exist, it creates a new one with default content.
#'
#' @return Invisible
#' @return This function does not return a value. It is used for its side
#' effects of setting up the environment for running long tests.
#' @export
#' @examples
#' # Create the longtests directory and .BBSoptions file
Expand Down
10 changes: 10 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ knitr::opts_chunk$set(
[![GitHub pulls](https://img.shields.io/github/issues-pr/xec-cm/biocroxytest)](https://github.com/xec-cm/biocroxytest/pulls)
<!-- badges: end -->

<br>

`r BiocStyle::Githubpkg("xec-cm/biocroxytest")` is an R package inspired by
`r BiocStyle::Githubpkg("mikldk/roxytest")`. It is specifically designed for
the development of Bioconductor packages that require tests with high execution
Expand All @@ -41,6 +43,8 @@ improves the reliability of the package but also enhances its maintainability.
Developers can easily locate, understand, and update these long tests as needed,
leading to more robust and efficient code.

<br>

## Installation instructions

Get the latest stable `R` release from [CRAN](http://cran.r-project.org/). Then
Expand All @@ -62,6 +66,8 @@ And the development version from [GitHub](https://github.com/xec-cm/biocroxytest
BiocManager::install("xec-cm/biocroxytest")
```

<br>

## Example

Here is how you can use `r BiocStyle::Githubpkg("xec-cm/biocroxytest")` to
Expand Down Expand Up @@ -125,6 +131,8 @@ test_that("Function bar() @ L27", {
})
```

<br>

## Contributing

- If you think you have encountered a bug, please [submit an issue](https://github.com/xec-cm/biocroxytest/issues).
Expand All @@ -133,6 +141,8 @@ test_that("Function bar() @ L27", {

- Working on your first Pull Request? You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://kcd.im/pull-request)

<br>

## Code of Conduct

Please note that the `r BiocStyle::Githubpkg("xec-cm/biocroxytest")` project is
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ issues](https://img.shields.io/github/issues/xec-cm/biocroxytest)](https://githu
pulls](https://img.shields.io/github/issues-pr/xec-cm/biocroxytest)](https://github.com/xec-cm/biocroxytest/pulls)
<!-- badges: end -->

<br>

*[biocroxytest](https://github.com/xec-cm/biocroxytest)* is an R package
inspired by *[roxytest](https://github.com/mikldk/roxytest)*. It is
specifically designed for the development of Bioconductor packages that
Expand All @@ -37,6 +39,8 @@ reliability of the package but also enhances its maintainability.
Developers can easily locate, understand, and update these long tests as
needed, leading to more robust and efficient code.

<br>

## Installation instructions

Get the latest stable `R` release from
Expand All @@ -59,6 +63,8 @@ And the development version from
BiocManager::install("xec-cm/biocroxytest")
```

<br>

## Example

Here is how you can use
Expand Down Expand Up @@ -123,6 +129,8 @@ test_that("Function bar() @ L27", {
})
```

<br>

## Contributing

- If you think you have encountered a bug, please [submit an
Expand All @@ -137,6 +145,8 @@ test_that("Function bar() @ L27", {
series [How to Contribute to an Open Source Project on
GitHub](https://kcd.im/pull-request)

<br>

## Code of Conduct

Please note that the
Expand Down
16 changes: 14 additions & 2 deletions man/use_longtests.Rd

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

7 changes: 7 additions & 0 deletions vignettes/biocroxytest.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ knitr::opts_chunk$set(
options(digits = 3)
```

<br>

The `r BiocStyle::Githubpkg("xec-cm/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 `r BiocStyle::Githubpkg("r-lib/roxygen2")` for test writing, which improves readability, code organization, and integrates seamlessly with package documentation.

Expand All @@ -38,6 +39,8 @@ In Bioconductor, daily tests are run as part of the nightly builds, with a maxim

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, `r BiocStyle::Githubpkg("xec-cm/biocroxytest")` contributes to the creation of robust, reliable, and efficient Bioconductor packages.

<br>

## biocroxytest setup

Once the `r BiocStyle::Githubpkg("xec-cm/biocroxytest")` package is installed, you need to carry out two steps to correctly set up long tests in your package:
Expand All @@ -61,6 +64,8 @@ biocroxytest::use_longtests()

With these two steps, your package will be set up to write, document, and store long tests directly in your `r BiocStyle::Githubpkg("r-lib/roxygen2")` comments, improving the efficiency and organization of your test code.

<br>

## Basic Process

The `r BiocStyle::Githubpkg("xec-cm/biocroxytest")` package allows you to add extensive tests to your functions using the `@longtests` tag in your roxygen comments. Here's a more detailed explanation of how to use it:
Expand Down Expand Up @@ -106,6 +111,8 @@ testthat::test_that("Function foo() @ L11", {

This file contains the long tests for the `foo()` function, ready to be run by `r BiocStyle::Githubpkg("r-lib/testthat")`.

<br>

## Session info

```{r}
Expand Down

0 comments on commit f6831ea

Please sign in to comment.