hadley/testthat — pull request #98 by kforner (2013-10-25 13:24:36+00:00)
Title: tests summaries as data frame

I am afraid this a huge pull request with many interrelated changes.
Here's an overview of the changes:

Because I needed to modify test_dir(), I started by adding a dedicated test (test-test_dir.r) because I'm not comfortable working without regression testing.

Doing so I discovered two bugs in source_dir(): it did not use the right path to find the helper scripts, and it did not use the chdir argument.

I then factored out some common code from test_dir() and test_file() into .test_file().
I also incorporated the changes we discussed by mail, using the enclosure of globalenv() as the enclosure of the environment in which the tests are evaluated.

I implemented two new Reporters:
* ListReporter that only just stores the results with the elapsed time, and keep infomation about the test file, and has a get_summary() method that outputs a data frame.
* MultiReporter that combines a list of reporters.

Finally I modified test_file(), test_dir(), test_package() and test_check() to output invisibly the summary data frame.
I tried to test the test_package() function, but I gave up. I'd need devtools, but I thought you wanted to keep the dependencies a minimal as possible.

The possible impact of outputting summary data frames should only be on execution time, and I hope it is minimal. We could put this in newer functions or cntrol the output with additional arguments.