I have spent some time on gcov and lcov. Finally, I have generated a nice .html representation of what test cases are covering, and what are not. The test coverage is very low, which indicates that there are more test cases to run [:
In general lcov is an utility (which uses gcov), that shows us (at least that is how I understand it till now :) how much of the code is covered by testcases. This greatly speeds up the process of creating test cases. Effect of the lcov can be seen in the attachment.
Anyways, I had a lot of problems with lcov and there are still a lot of things to be done (mainly automatisation).
Here is my little summary, it might be helpfull for Cygwin users
1) When compiling the code, you should add the following flags: -fprofile-arcs -ftest-coverage
2) When linking the code, you should add the following flags: -fprofile-arcs -lgcov
3) gcov must have the correct version! If you are using (for example) a g++ compilet version 4.x.x, then it is most certain that gcov with version 3.x.x will start spitting errors. The problem is that lcov utility uses gcov.exe file. If you have gcov-4.exe file you have to manualy rename it (or edit the gcov.exe link) in your bin directory.
4) Where to get gcov-4? When installing cygwin, choose Delevel directory, and then choose gcc4-core package.
5) lcov can be found easily on the internet. After downloading lcov, check the Makefile to find out where to put proper files. Also read the Makefile from the example to find out how to make that cool html output [;
6) lcov will sometimes spit errors such as "ERROR: cannot read xxxxx file". It doesn't mean that the file doesn't exist. It means that the file hasn't got proper privileges set. You have to chmod that file (the best would be to chmod the whole directory ;). If chmod doesn't work, you have to set privilages from Windows, after that chmod should work fine.
And that is all folks! By the end of this year I will work on automating the test coverage.