Re: [R] Approaches to using RUnit

2004-08-12 Thread Seth Falcon
On Tue, Aug 10, 2004 at 04:53:49PM +0200, Klaus Juenemann wrote:
 If you don't organize your code into packages but source individual R
 files your approach to source the code at the beginning of a test file
 looks the right thing to do.

Appears to be working pretty well for me too ;-)

 We mainly use packages and the code we use to test packages A and B, 
 say, looks like 

SNIP

 We use the tests subdirectory of a package to store our RUnit tests
 even though this is not really according to R conventions.

In an off list exchange with A.J. Rossini, we discussed an alternative
for using RUnit in a package.  The idea was to put the runit_*.R files
(containing test code) into somePackage/inst/runit/ and then put a
script, say dorunit.R inside somePackage/test/ that would create the
test suite's similar to the code you included in your mail.  The
advantage of this would be that the unit tests would run using R CMD
check.

In the next week or so I hope to package-ify some code and try this out.  


+ seth

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Approaches to using RUnit

2004-08-09 Thread A.J. Rossini
Seth Falcon [EMAIL PROTECTED] writes:

 Having used JUnit and PyUnit, I was pleased to see the release of the
 RUnit package on CRAN.

 I'm wondering if there are any RUnit users out there that would be
 willing to share some tips on how they organize their code to work with
 RUnit.

 Specifically, I'm wondering about the best way to load/import/source the
 functions to be tested.  I would like to end up with a script, testall
 or some such, that allows me to run all the unit tests in a given
 directory.

Hi Seth -

The version that I was working on (before the other folks released a
less eclectic and more functional/general package) had a

 testrunner(test=c(list,of,functions),testall=FALSE)

API, along with a preliminary tcltk 

 GUIrunner() 

with a similar intended API.  I've been trying to find the initiative
to integrate (overlay) those tools with the current RUnit as an
add-on, but the difference is that I attached tests as S4 object
instantiations.

Stop by if you want to chat a bit about it.

best,
-tony

-- 
Anthony Rossini Research Associate Professor
[EMAIL PROTECTED]http://www.analytics.washington.edu/ 
Biomedical and Health Informatics   University of Washington
Biostatistics, SCHARP/HVTN  Fred Hutchinson Cancer Research Center
UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable
FHCRC  (M/W): 206-667-7025 FAX=206-667-4812 | use Email

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html