[tor-dev] Unit tests that need writing in core
Nick Mathewson
nickm at freehaven.net
Mon Jun 2 02:48:53 UTC 2014
On Sat, May 31, 2014 at 9:15 AM, Ajay Bhat <a.ajay.bhat at gmail.com> wrote:
> Hi,
>
> I'd like to contribute to tor core by writing any unit tests that need to be
> done. Can anyone please help me out by pointing out the code/modules that
> needs to be tested?
Hi, Ajay! I've been meaning to write an all-purpose "how to test Tor"
document, but until I can get that done, here's how I find out what to
test. I take the latest version of the git master branch, and I
configure it with the --enable-coverage option. Then I run "make
check" , and "mkdir tmpdir" and "./scripts/test/coverage tmpdir".
That creates a bunch of .gcov files in the temporary directory
"tmpdir", which shows which lines have coverage. (All the lines
beginning with ### are lines that were not visited by the unit tests.)
In other words:
./configure --enable-gcc-warnings --enable-coverage
make
make check
mkdir tmpdir
./scripts/test/coverage tmpdir
I've run this on today's master branch, and put the results in
http://www.wangafu.net/~nickm/volatile/tor-coverage-be90580.tar.bz2
(This URL is temporary.)
I've also attached a list of the modules in Tor, sorted by the
fractions of lines covered by tests today. The numbers after each
line are the number of uncovered lines, the number of covered lines,
and total percentage of covered lines.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cov-by-module-be90580
Type: application/octet-stream
Size: 3715 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20140601/392aec31/attachment.obj>
More information about the tor-dev
mailing list