hadley/test_that — Issue #30: Feature request: extend flexibility of arg 'code_path' in 'auto_test()'
Author: Songpants
Created: 2012-01-10 13:40:01+00:00
State: open

Hi Hadley,

first of: thanks a LOT for this package! It's really awesome and makes code testing a lot of fun!

One question/feature request though:
AFAIU, arg 'code_path' expects a directory containing one ore numerous definition scripts (for classes, methods, functions etc.).

Now, I've come up with a custom project structure for my code that serves as an intermediate step towards the creation of a full-grown R package. Hence, it does not completely resemble the structure of an R package yet (with R files residing in directory 'R'). Instead, actual definition code is organized as follows:

~/lib
~/lib/clss (class defs)
~/lib/fcns
~/lib/fcns/gnrcs (defs of generic methods)
~/lib/fcns/mthds (defs of S4 methods)
~/lib/fcns/stnds (defs of regular/standard R functions)

The problem is, that besides those directories, 'lib' also contains other dirs such as 'app' (applications scripts), 'prof' (profiling scripts), 'test', 'examples' etc.
Therefore

auto_test(code_path="~/lib", test_path="~/lib/tests")

will throw errors. So before going ahead and reorganizing my directory structure, I wondered if it'd be possible to extend arg 'code_path' to a *vector* of character strings instead of just allowing an atomic string. That way, I could launch

auto_test(code_path=c("~/lib/clss", "~/lib/fcns", test_path="~/lib/tests")

It'd be great if you could consider this for future releases!

Thanks a lot,
Janko