Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

raise a NOTE exception during R CMD check

Tags:

r

cran

r-package

Is there any way I could raise my own NOTE exception from within the unit tests in the checking tests ... step of R CMD check?
In general I would like to have a NOTE in 00check.log if database was not available during unit tests.
Dirty solutions welcome.

Update: Actually I see much more use cases for such feature, adding bounty.

like image 690
jangorecki Avatar asked Feb 06 '16 15:02

jangorecki


1 Answers

Generally tests are run in a separate process. The Log object that Dirk referred to is a local variable in the original process, so there's no way to access it.

Errors in the child process are detected by a non-zero return value. Other anomalies in the test script aren't seen unless you've saved a copy of the desired output; then the comparison of new output with old would see them.

like image 159
user2554330 Avatar answered Sep 19 '22 12:09

user2554330