I am trying to perform a coverage test of a shared library. I have chosen for gcov/lcov due to the fact, that it is free and open source, which means, I can try it immediately (commercial software would need to be approved/purchased, a lot of decision would have to be made - it costs time).
The situation is as follows - the library - our product, written in Fortran is then used for simulation software (ADAMS from MSC.Software, to be specific). I can compile the library with -fprofile-arcs -ftest-coverage and it works properly if used by ADAMS. However, no .gcda files are created.
There is a small test executable to test basic behaviour of the library (small subset of the methods). If I compile this executable with coverage tests switches, I get .gcda files for both the executable itself and the library.
The question is: is it possible to invoke gcov measurements for the library if the executable using the library was not compiled with coverage test switches? And if yes, how?
It is possible to write extensive test, but it will be almost like replicating ADAMS (or any other simulation package). Or have I chosen wrong coverage test tool and I should move to commercial products?
Thank you in advance.
Mike
It seems, there isn't any problem with code coverage test of the library that is invoked by proprietary software. One should only pay attention to compile all components with the same version of the compiler and use corresponding gcov version. In my case the library (in Fortran) was compiled with f77 (gcc-3.4.6), the component of it was compiled with newest gcc (gcc-4.4). The wrapper for the library used by ADAMS was compiled again with gcc-3.4.6 and gcov used was 4.1.
Using gcc-3.4.6 for all components delivered very appealing code coverage test results.
Consider the topic closed, but should anyone have questions, please ask. I'll gladly share my experience.