1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
if (require("testthat")) {
library(insight)
is_dev_version <- length(strsplit(packageDescription("insight")$Version, "\\.")[[1]]) > 3
if (is_dev_version) {
Sys.setenv("RunAllinsightTests" = "yes")
} else {
Sys.setenv("RunAllinsightTests" = "no")
}
si <- Sys.info()
osx <- tryCatch(
{
if (!is.null(si["sysname"])) {
si["sysname"] == "Darwin" || grepl("^darwin", R.version$os)
} else {
FALSE
}
},
error = function(e) {
FALSE
}
)
solaris <- tryCatch(
{
if (!is.null(si["sysname"])) {
grepl("SunOS", si["sysname"], ignore.case = TRUE)
} else {
FALSE
}
},
error = function(e) {
FALSE
}
)
# disable / enable if needed
if (.Platform$OS.type == "unix" && is_dev_version) {
Sys.setenv("RunAllinsightStanTests" = "yes")
} else {
Sys.setenv("RunAllinsightStanTests" = "no")
}
# if (!osx && !solaris) {
# test_check("insight")
# }
test_check("insight")
}
|