joshuaulrich / TTR

Technical analysis and other functions to construct technical trading rules with R
GNU General Public License v2.0
326 stars 102 forks source link

Disable RUnit reports when run via R CMD check #56

Closed joshuaulrich closed 6 years ago

joshuaulrich commented 6 years ago

This type of code writes report files in (sub-directories of) the directory where the package checked was installed, which is naughty according to the CRAN Repository Policy.

path <- system.file(package=pkg, "unitTests")
# ...
pathReport <- file.path(path, "report")

printTextProtocol(tests, showDetails=FALSE,
                  fileName=paste(pathReport, "Summary.txt", sep=""))
printTextProtocol(tests, showDetails=TRUE,
                  fileName=paste(pathReport, ".txt", sep=""))

So we need to disable report-generation if run via R CMD check.