From rossini@biostat.washington.edu  Mon Mar 15 18:35:39 1999
From: rossini@biostat.washington.edu (A.J. Rossini)
Date: 15 Mar 1999 10:35:39 -0800
Subject: R packages and test code
In-Reply-To: Martin Maechler's message of "Mon, 15 Mar 1999 10:40:14 +0100"
References: <87pv6b9vqn.fsf@alpha.cfas.washington.edu> <199903150940.KAA09497@sophie.ethz.ch>
Message-ID: <87sob6eh38.fsf@alpha.cfas.washington.edu>


>>>>> "MM" == Martin Maechler <maechler@stat.math.ethz.ch> writes:
>>>>> "tony" == A J Rossini <rossini@biostat.washington.edu> writes:

    tony> Where is the best place to put evaluation/test code in
    tony> creating an R package?  I thought about a test subdirectory,
    tony> but might it be better to put in the R directory?  I guess
    tony> I'm more concerned about the output used for evaluating the
    tony> success of the test, rather than the test code and data,
    tony> itself.

    MM> Good question.  This hasn't been done yet in a formal general
    MM> way.  MASS comes with the scripts subdirectory, but there's no
    MM> "make check" and comparison of desired and actual output.

Is there a more formal description of the packaging system than that
given in the R-faq (which needs a bit of an update for ESS, Kurt)?

(I'd like to see one, if so, in order to specify exactly how to
consider the general situation).


    MM> 2) I assume the thing you desire is something like
    MM>    what the distributed R does in ./tests/ where there are
    MM>    foobar.R and foobar.Rout.save files
    MM> 	     for (foobar in c("is-things", "simple-tests",
    MM> 	     "eval-etc",
    MM> 			      ...)) :
    MM>       R --vanilla < foobar.R > foobar.Rout
    MM>    is run and a somewhat "tolerant" diff between foobar.Rout
    MM>    and foobar.Rout.save is made. "SUCCESS" (actually `Ok') is
    MM>    reported when there are no (nontrivial) diffs.

Yes, but not quite as formal as checking for non-trivial diffs.  I'd
be satisfied with just being able to construct a diff (or the new
file, to compare with the gold standard, for the diff) and making the
user visually go over them.

    MM> Tony, could you try to add this feature (to the relevant R
    MM> scripts) yourself?  or anyone else?  [it would be nice of
    MM> course, if the identical scripts were used for
    MM>  "base R"'s ``make check'' and for the contributed packages's
    MM>  "R CMD check .. pkg" or (preferably) "R INSTALL pkg ..."
    MM> ]

I can try, since I really want this (the tests, and quite possibly the
packaging specification for my next stat language project :-).
Probably won't happen until after my Vienna/Berlin/Atlanta trips over
the next 2+ weeks...

best,
-tony

-- 
A.J. Rossini
UW Biostatistics & Center for AIDS Research 
206-543-1044 / 206-720-4282                 
rossini@biostat.washington.edu              
http://www.biostat.washington.edu/~rossini/ 
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


R packages and test code
A.J. Rossini