-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make optional test deps really optional (#248)
* Make optional test deps really optional Cf. #247. * Skip test if withr is not installed * Trying to fix GHA Need an older magick package on Windows && R < 4.0.0 * Give up on R 3.6.x on Windows :( Can't build an older version of magick, either.
- Loading branch information
1 parent
9a61008
commit 371467a
Showing
18 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ Imports: | |
Suggests: | ||
asciicast (>= 2.3.1), | ||
cli (>= 1.1.0), | ||
covr, | ||
mockery, | ||
ps, | ||
rprojroot, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
is_true_check_env_var <- function(x, default = "") { | ||
# like utils:::str2logical | ||
val <- Sys.getenv(x, default) | ||
if (isTRUE(as.logical(val))) return(TRUE) | ||
tolower(val) %in% c("1", "yes") | ||
} | ||
|
||
isFALSE <- function(x) { | ||
is.logical(x) && length(x) == 1L && !is.na(x) && !x | ||
} | ||
|
||
is_false_check_env_var <- function(x, default = "") { | ||
# like utils:::str2logical | ||
val <- Sys.getenv(x, default) | ||
if (isFALSE(as.logical(val))) return(TRUE) | ||
tolower(val) %in% c("0", "no") | ||
} | ||
|
||
# Only skip if _R_CHECK_FORCE_SUGGESTS_ is false | ||
|
||
skip_if_not_installed <- function(pkg) { | ||
if (!is_false_check_env_var("_R_CHECK_FORCE_SUGGESTS_")) return() | ||
testthat::skip_if_not_installed(pkg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
library(testthat) | ||
|
||
library(callr) | ||
|
||
test_check("callr") | ||
if (callr:::is_false_check_env_var("_R_CHECK_FORCE_SUGGESTS_")) { | ||
if (requireNamespace("testthat", quietly = TRUE)) { | ||
library(testthat) | ||
test_check("callr") | ||
} | ||
} else { | ||
library(testthat) | ||
test_check("callr") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters