[Rd] Re: [R] sub directories in the tests directory of a package

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Sun, 18 Nov 2001 19:36:06 +0100


>>>>> "David Kane writes:

> It seems like any directories (and their contents) beneath the /tests
> directory of an R package are not copied over completely when R CMD
> check is run. This causes problems (for me) when the tests for a
> function require some sort of directory structure. For example, I have
> an R function that iteratively searches through a directory tree for a
> specific file. Currently, I can not put the inputs for a test for that
> function in the /tests directory. It would seem that better behavior
> would be for R CMD check to simply (recursively) copy everything from
> the /tests directory in the package into the /tests directory in the
> .Rcheck directory, similar to the way that everything in /inst is
> copied over during INSTALL.

> Any suggestions? I poked around in the R CMD check code, but my Perl
> is even worse than my R. Or am I missing something?

Currently, it is assumed that tests has no subdirectories.  This has
been raised before, with the result that the Perl gurus were not sure
how to portably recursively copy a directory (apparently, Perl/CPAN has
rmtree, but no cptree?).

I think if you simply want to find a file in a dir tree, you could have
your test code create the tree first.

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._