jeudi 24 août 2017

R: How to tell if any tests failed from result of testthat::test_dir

I have a small testing program that uses testthat

library(testthat)
source("src/MyFile.r")
results <- test_dir("tests", reporter="summary")

So, I am running this via Rscript. The problem is that the exit code is always 0 even when there were test failures. So, I want to call stop if there are any failures. But I can't seem to get the right bit of code to do that. Is there a method or field in results that I should be looking at to determine if there were any errors?

Aucun commentaire:

Enregistrer un commentaire