[Bioc-devel] unit tests for C code inside a package

Peter Haverty haverty.peter at gene.com
Mon Jan 26 15:58:15 CET 2015


My favorite solution to this would be to use Rcpp attributes to add R-level functions for each C function. You can use these just for testing and skip the exporting and manual pages. That's not quite what you asked for but it would work. 
BTW transcription factors are my thing so I'm eager to try out the package. Thanks!

Typed with thumbs.

> On Jan 26, 2015, at 1:14 AM, Elena Grassi <grassi.e at gmail.com> wrote:
> 
> Hi,
> 
> I'm writing a package that calculates total affinity (see PMID
> 21335606 and 16873464 if transcription factors are your thing):
> up until now in our lab we've used a pure C tool that needs fasta and
> tabular formatted PFM-PWM files but we are willing to produce
> something more comfortable that stems from some related Bioc packages
> (TFBSTools and JASPAR2014 basically).
> The package has two simple R methods that call a C entry point and
> then all the calculations are performed by the C code.
> I'd like to write extended unit tests but I am not sure how to do it:
> I've some tests for the R portions (that obviously depends
> also on the C calculation in some parts) but I would like to test in a
> more fine grained way the C code therefore RUnit and BiocGenerics
> seems to solve only a portion of my problem. I would like to use a
> C-based library for unit testing and link it to the automatic
> check done for the package thanks to BiocGenerics: is this reasonable?
> I've looked at some other packages without being able to find
> something similar to this.
> I've read http://stackoverflow.com/questions/26322135/unit-testing-rcpp-code-in-a-package,
> but I think
> that it would be nice to test the C code with the whole package.
> 
> Thanks,
> E.
> ps. the source code right now is here:
> https://github.com/vodkatad/MatrixRider (the vignette is on its way,
> the nodevel branch is the one active now and it works with R version
> 3.1.2 and Bioconductor 3.0 for our internal use).
> 
> -- 
> $ pom
> 
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list