We suppose that the project contains N libraries in the directories
libprojN
. Each library generated are static libraries, and they are
generated in libprojN
. We have N unit tests, all of them are
located in testprojM
directories.
So the directory tree looks as follows:
First we need to execute the unit tests:
After execting this bash script, a .csexe
file is created for each
unit test:
We import then each testprojM.exe.csexe
file into its
testprojM.exe.csmes
file:
Now, the files testprojM.exe.csmes
contain the coverage information
of the unit tests and the libraries that were tested. The files
testprojM.exe.csexe
are deleted because they are no longer needed.
It is now possible to import the coverage information of the unit
tests into the .csmes
file of each tested library:
This script imports into each file libprojN.a.csmes
all its unit
test results. The -i
command line option lets cmmerge ignore the
source files which are not present in libprojN.a.csmes
. This way,
the test code is ignored during the merge process.