# \donttest{
# Save and adjust CRAN mirror for reproducibility
r <- getOption("repos")
old <- options(repos = r)
r["CRAN"] <- "http://cran.us.r-project.org"
options(repos = r)
# Example package from test.assessr
dp <- system.file(
"test-data",
"test.package.0001_0.1.0.tar.gz",
package = "test.assessr"
)
# Set up package source directory
install_list <- set_up_pkg(dp)
pkg_source_path <- install_list$pkg_source_path
# Install locally to enable testing and coverage
package_installed <- install_package_local(pkg_source_path)
if (isTRUE(package_installed)) {
coverage_results <- run_coverage(pkg_source_path)
}
# Restore user's original repository settings
options(old)
# }
Run the code above in your browser using DataLab