Run tests on multiple inter-dependency packages

91 Views Asked by At

I wonder what would be the best way of testing multiple packages. Let's say we have two local packages:

src/pkg1
src/pkg2

The package pkg1 has a dependency on pkg2. I test all packages using R CMD check in the makefile:

for pkg in src/*; do \
    R CMD check $$pkg

Which fails because of the missing dependencies. For example in Java you can include all missing code in the path. I can install first all R src/pkgs but this will leave artifacts on the end of the test in the R.

Is there any recommended way to perform such tests in R or installing all packages is the only solution? Maybe there is a way to use a specific folder for tests only so no other already installed packages would be affected?

1

There are 1 best solutions below

0
On

Turns out I can use "-l" flag with both

R CMD INSTALL -l /path

and with

R CMD check -l /path

That should solve the problem but won't really cover the issues with more complex inter-dependencies.