On Wed, Aug 23, 2006 at 08:32:09AM +0900, Tomasz Wegrzanowski wrote:
> I have a program compiler.rb, that compiles something.
> The test driver is a separate program, that runs compiler.rb, then feeds
> the results to a virtual machine, and checks if it gets expected results.
> 
> Now I'd like to verify that every single line of compiler.rb is
> covered by tests.
> How can I make rcov merge information from multiple runs of compiler.rb ?

You can use the --aggregate option, which was added in 0.7.0.
Essentially, you just have to run your program using rcov with the
--aggregate FILE option:
  rm -f coverage.data
  rcov -t --no-html --aggregate coverage.data bin/compiler.rb -- -args --to --compiler.rb bar.src
  rcov --aggregate coverage.data bin/compiler.rb -- -some --other --args foo.src

You can skip HTML report generation in all but the last run with --no-html;
the -t (text summary) option stops rcov from complaining about the lack of
files to analyze.

There's some additional information about how to do it both manually and with a
Rake task at 
  http://eigenclass.org/hiki.rb?rcov+0.7.0

Note that --aggregate is fairly slow since all the execution count and
coverage information must be saved in the specified file, as well as the code
that was loaded (since in a later execution different files could be
loaded/parsed).

-- 
Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby