forked from r-lib/cpp11
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.R
More file actions
27 lines (23 loc) · 663 Bytes
/
test.R
File metadata and controls
27 lines (23 loc) · 663 Bytes
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
#' Run the cpp11 tests
#' @inheritParams testthat::test_check
#' @export
run_tests <- function(reporter = testthat::default_reporter()) {
if (interactive()) {
if (pkgload::is_dev_package("cpp11")) {
# load cpp11
pkgload::load_all(system.file(".", package = "cpp11"))
# load cpp11test
pkgload::load_all(system.file("cpp11test", package = "cpp11"))
} else {
# load cpp11
pkgload::load_all("..")
# load cpp11test
pkgload::load_all()
}
}
old <- getwd()
on.exit(setwd(old))
setwd(system.file("tests", package = "cpp11test"))
library(testthat)
test_check("cpp11test", reporter = reporter)
}