miraisolutions / rTRNG

R package providing access and examples to TRNG C++ library
GNU General Public License v3.0
19 stars 5 forks source link

Address CRAN package check macOS issues #10

Closed riccardoporreca closed 4 years ago

riccardoporreca commented 4 years ago

Before submitting a new version of rTRNG to CRAN, we should address the macOS errors on the CRAN package check page.

In particular, the following issues are reported

Some tests are failing on macOS

══ testthat results ═══════════════════════════════════════════════════════════
[ OK: 581 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 30 ]
1. Failure: $split errors for out-of-range subsequence indices (@test-TRNG.Engine.R#264)
...

In fact we have exactly 30 warnings when running tests in Ubuntu for the same test reported here

test-TRNG.Engine.R:264: warning: $split errors for out-of-range subsequence indices
`e$split(p, 0L)` generated an S3 error and you are testing the error message.
* The error has class = c("std::invalid_argument", "C++Error", "error", "condition")
* Testing with `class` is more robust than testing with `regexp`.
* Do you want `expect_error(..., class = "std::invalid_argument")`?

Most likely this is detected as a failure under macOS, and fixing the expectation as hinted in the warning message might solve the issue.

Re-building the vignettes fails on macOS (and Solaris)

This happens for C++ code chunks using sourceCpp()

Library not loaded: rTRNG.so
riccardoporreca commented 4 years ago