with_safe_package_tester: Create a safe environment in which certain expressions can be...

View source: R/test_functions.R

with_safe_package_testerR Documentation

Create a safe environment in which certain expressions can be tested

Description

Will reset the .libPaths, the 'R_MV_LIBRARY_LOCATION' environment variable to their old values and will unload 'package.a' till 'package.f' when finishing the execution.

Usage

with_safe_package_tester(expr, also_clean_install_dir = FALSE)

Arguments

expr

The expression that needs to be evaluated in this protected environment.

also_clean_install_dir

If lib.clean_install_dir() must be run before and after the test.

Details

Before execution it will set the following values:

  1. .libPaths - will be set to .Library only.

  2. R_MV_LIBRARY_LOCATION - will contain '../test_library/' or 'tests/test_library/' depending on the current directory.


multiversion documentation built on March 22, 2022, 1:07 a.m.