-
Notifications
You must be signed in to change notification settings - Fork 5
Using rcov with qed
To run your qed demos through rcov you need to know the path to the qed command on your system. On a unix-based system the easiest way to find that is via
> type -p qed
You then use that path as the target file of the rcov command and supply the qed demo files as arguments after the double hyphen separator (—). Eg.
> rcov -o log/rcov -x qed /usr/bin/qed -- test/demo/mydemo.rdoc
You can also use the type call directly in the call to rcov
, which is a little more convenient:
> rcov -o log/rcov -x qed $(type -p qed) -- test/demo/mydemo.rdoc
Without the -x qed
the rcov reports will include coverage for the qed library itself.
A patch has been submitted to relevance/rcov that would allow rcov to be invoked via Ruby as it is via the command-line (supporting all the same options). If the patch ever gets applied, then support for rcov can be improved by adding a qed run profile to your qed configuration that sets up an rcov session upon invocation of qed
, allowing coverage to more precisely target the desired code.
Here is a preliminary example of what the configuration entry might look like:
Before do require 'rcov/session' $qed_rcov = Rcov::Session.new(:output=>'log/rcov') $qed_rcov.run end