From edd at debian.org  Sun Dec 14 21:32:55 2008
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun, 14 Dec 2008 14:32:55 -0600
Subject: [Rd] package development
In-Reply-To: <49428BB7.6030406@bank-banque-canada.ca>
References: <200812112304.mBBN4stJ008607@rocky.mayo.edu>
	<4941A995.1040409@stats.uwo.ca>
	<49427147.5070204@bank-banque-canada.ca>
	<e8e755250812120747x241cde78y65e12b3a27ea518a@mail.gmail.com>
	<49428BB7.6030406@bank-banque-canada.ca>
Message-ID: <18757.28023.55046.821105@ron.nulle.part>


On 12 December 2008 at 11:05, Paul Gilbert wrote:
| Yes, there are several options for not distributing tests.  I was 
| thinking more about how to distribute them with a simple mechanism for 
| anyone to run them, but in a way that they are not run by the usual R 
| CMD check.

One scheme I quite like (despite its "heavy" feel) is what Martin Maechler
had cooked up for the Rmetrics packages, based on earlier work by Gregor
Gorjanc in the gdata package:

 -- it uses RUnit, so you get the full support of a mature unit testing
    framework.

 -- the tests are installed in inst/unitTests and hence available for tests
    during package build as well as once installed which is nice as you can
    re-rerun tests on installed packages 

 -- tests/ has a 'hook' script that calls the tests from ../inst/unitTests
    during the 'R CMD check' run

Any Rmetrics package can serve as an example. I just checked with timeSeries.

It may be possible to detect whether these are called during R CMD check
or not. If not, it may be worth adding another variable, or value in
options() or whathaveyou to make it detectable.

Dirk

-- 
Three out of two people have difficulties with fractions.



[Rd] package development
Dirk Eddelbuettel