<div dir="ltr">There is also a way to write C++ unit test with the catch framework and have them added to the R test suite: <a href="https://rdrr.io/cran/testthat/man/use_catch.html">https://rdrr.io/cran/testthat/man/use_catch.html</a><div><br></div><div>Note this was originally built with integration with testthat in mind but you can call it from any R test suite (docs on doing this are on the linked to page).</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 12, 2017 at 3:47 PM, Wolf Vollprecht <span dir="ltr"><<a href="mailto:w.vollprecht@gmail.com" target="_blank">w.vollprecht@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">RInside seems to have done the trick! Awesome.<div><br>I have no strong opinions on how to implement the tests. The only reason why I wanted the embedded R solution is because we use it that way with Python and Julia, and it gives us "raw C++" tests. In the future, we might also have a xtensor-test package, that we can easily use to write tests for all three languages (in C++) at the same time (through metaprogramming).</div><div><br></div><div>But we will definitly also add tests in R (as we have done with Python and Julia, too).</div><div>It would be awesome if you have a chance to add some to your variant.</div><div>I am going to fix up the C++ tests that I've added to the "big" PR and make sure that at least those we have right now work fine to establish a baseline to work from.</div><div><br></div><div>Cheers! </div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Wolf</div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-06-12 4:11 GMT-07:00 Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 12 June 2017 at 11:22, Romain Francois wrote:<br>
| You might be looking for RInside.<br>
<br>
Exactly correct in the narrow sense of 'how to get R going from C++'.<br>
<span><br>
On 12 June 2017 at 01:11, Wolf Vollprecht wrote:<br>
| I am trying to run C++ tests from C++ directly. <br>
| It looks like I need to start the R interpreter for memory management etc.<br>
<br>
</span>The wider, normal sense of the question is, I suspect, how to add unit tests<br>
to an R package such as your xtensor-r.  Give me a day or two and I may get a<br>
chance to add this to my variant of your project.<br>
<br>
You generally do NOT want force an embedded R interpreter __as any Rcpp<br>
project is already called from R__.  Use CRAN as a repository of (as of<br>
today) 1045 example packages.  I don't think a single one embeds R for<br>
testing.  The RUnit (older, used by Rcpp itself) and testthat frameworks are<br>
popular.<br>
<span class="m_-8428939798977045225HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</font></span></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-<wbr>project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-<wbr>project.org/cgi-bin/mailman/<wbr>listinfo/rcpp-devel</a><br></blockquote></div><br></div>