[Rd] proposal to allow just transcript files (output only) in the 'tests' directory
Tony Plate
tplate at acm.org
Tue Feb 20 20:14:11 CET 2007
Currently, as far as I can see, both input and output fles must be
supplied in the 'tests' directory (the input in a '.R' file, and the
output in a corresponding '.Rout.save' file.) Often, the '.R' file is
redundant, as it could be reconstructed by simply stripping the commands
out of the '.Rout.save' file. E.g., the command
$ sed -n -e 's/^[>+] //p' ./src/library/stats/tests/nls.Rout.save
produces the same R commands as in ./src/library/stats/tests/nls.R
If I've missed something, and this is already supported, my apologies, &
please let me know.
If indeed this facility is not present, would anyone from the R core
group consider an addition to allow '.Rt' (or '.Rt.save') files in the
'tests' directory? These would by just like the '.Rout.save' files,
except that no corresponding '.R' file would be required -- the R
commands would be extracted from them by simple line processing. Of
course, '.R' and '.Rout.save' files could still be used where necessary
or preferred.
The primary advantage of this change would be to make it easier to add
and maintain tests -- only one file would need to be created or changed,
and no redundant information would be required. My view is that tests
should be as easy as possible to create and maintain, and the current
system adds a small amount of unnecessary difficulty.
If such an addition would be considered, I would be happy to supply
patches to implement it (and test them in a build under Windows &
Linux). I have tested a prototype, and it seems pretty simple to add
this: as far as I can see, small changes are needed in three files:
./share/make/tests.mk
./src/gnuwin32/fixed/share/tests.mk
./bin/check
Please respond with
comments/suggestions/corrections/pointing-out-of-gotchas/etc!
thanks,
Tony Plate
More information about the R-devel
mailing list