Skip to content

R CMD check with Matlab and perl?

4 messages · Duncan Murdoch, Paul Gilbert, Spencer Graves

#
Hi, All: 

      How might one test Matlab and perl code during "R CMD check"? 

      I ask for two reasons:  First, the "fda" package exists in both R 
and Matlab, and it would help if we could run test examples in Matlab as 
part of "R CMD check".  I tried "R.matlab", but could not get it to work 
in that context. 

      Second, I have professional colleagues who write code in Matlab 
and perl, but have no unit or regression testing.  If I could test 
Matlab and perl from within "R CMD check" examples, I think I could get 
them to use it, because it would produce more "trustworthy software" 
[the "Prime Directive" of Chambers (2008) Software for Data Analysis 
(Springer)] AND give them documentation at the same time -- while 
simultaneously reducing the cost of producing and maintaining code to 
given specifications. 


      Thanks,
      Spencer
#
Spencer Graves wrote:
Can you run the tests from the command line?  If so, you should be able 
to call them from system() in a script in the tests directory,
or in an example section of an Rd file.

Duncan Murdoch
#
Spencer

I do something a bit like this using make, and some "R like" directory 
organization, to do "unit testing" of code for installing/checking 
databases. The tests/ and an examples/ directory I added are fairly 
straightforward. The fancier R things, like parsing examples out of Rd 
files, and checking that documented arguments correspond to code, are 
not so easy.

I think most of this fancy stuff is very specific to the R package 
context, but it would be useful to think about how much of it could be 
generalized.  Let me know if you want more detail on my test setup.

Paul
Spencer Graves wrote:
====================================================================================

La version fran?aise suit le texte anglais.

------------------------------------------------------------------------------------

This email may contain privileged and/or confidential information, and the Bank of
Canada does not waive any related rights. Any distribution, use, or copying of this
email or the information it contains by other than the intended recipient is
unauthorized. If you received this email in error please delete it immediately from
your system and notify the sender promptly by email that you have done so. 

------------------------------------------------------------------------------------

Le pr?sent courriel peut contenir de l'information privil?gi?e ou confidentielle.
La Banque du Canada ne renonce pas aux droits qui s'y rapportent. Toute diffusion,
utilisation ou copie de ce courriel ou des renseignements qu'il contient par une
personne autre que le ou les destinataires d?sign?s est interdite. Si vous recevez
ce courriel par erreur, veuillez le supprimer imm?diatement et envoyer sans d?lai ?
l'exp?diteur un message ?lectronique pour l'aviser que vous avez ?limin? de votre
ordinateur toute copie du courriel re?u.
#
Dear Paul: 

<in line>
Paul Gilbert wrote:
Yes, I would like more detail.  Only yesterday, I was reviewing 
your article in R News on "R Package Maintenance".  I could study that 
and your comments here more carefully.  However, it would help to have a 
bit more detail on how you make this work. 

      Thanks very much. 
      Spencer