David Kane <David Kane
2001-Nov-16 11:52 UTC
[R] sub directories in the tests directory of a package
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? Thanks, Dave Kane> version_ platform sparc-sun-solaris2.6 arch sparc os solaris2.6 system sparc, solaris2.6 status major 1 minor 3.1 year 2001 month 08 day 31 language R -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Kurt Hornik
2001-Nov-18 18:36 UTC
[Rd] Re: [R] sub directories in the tests directory of a package
>>>>> "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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._