I have a project that I compile with the intel toolchain. All the .f90
files are compiled to corresponding .o
files in the bin directory. When I use the codecov
utility I get an HTML with the list of covered files. However that list is missing a bunch of files which should be eligible for coverage. Some of the modules contained in those files are even used during the runs.
What could be a reason for these files to be missing from the coverage report?
EDIT
Running the binary with a debugger I noticed something which might be a clue.
If I try to set a breakpoint in the files that are not covered gdb
throws an error:
No line xxx in file "disturb_coms.f90".
However disturb_coms.f90
is in the bin folder:
manfredo@cave05:build$ ll bin-dbg-A/disturb*
-rw-r--r-- 1 manfredo staff 15K Jun 29 10:41 bin-dbg-A/disturb_coms.f90
-rw-r--r-- 1 manfredo staff 3.9K Jun 29 10:41 bin-dbg-A/disturb_coms.mod
-rw-r--r-- 1 manfredo staff 4.9K Jun 29 10:41 bin-dbg-A/disturb_coms.o
-rw-r--r-- 1 manfredo staff 221K Jun 29 10:43 bin-dbg-A/disturbance.f90
-rw-r--r-- 1 manfredo staff 4.1M Jun 29 10:43 bin-dbg-A/disturbance.o
-rw-r--r-- 1 manfredo staff 3.2M Jun 29 10:43 bin-dbg-A/disturbance_utils.mod
and was compiled with:
ifort -c -FR -CB -O0 -check -g -prof-gen=srcpos -debug full -debug-parameters all -fpe0 -traceback -ftrapuv -fp-stack-check -implicitnone -assume byterecl -warn unused -warn uncalled -warn usage -gen-interfaces -I../../src/include -I/usr/local/hdf5_mio/include disturb_coms.f90
Furthermore a file called disturbance.f90
contains the following lines:
module disturbance_utils
contains
subroutine apply_disturbances(cgrid)
...
use disturb_coms , only : treefall_disturbance_rate ! ! intent(in)
...
cpoly%disturbance_rates(2,2,isi) = treefall_disturbance_rate
...
end subroutine apply_disturbances
end module disturbance_utils
where disturb_coms
is used, and the file disturbance is actually covered.
EDIT
By adding a write instruction inside disturb_coms.f90
and trying to compile I get the following error:
disturb_coms.f90(44): error #6274: This statement must not appear in the specification part of a module.
write(*,*) "try"
^
I don't have much experience with Fortran but it looks to me as if that module is a kind of c-equivalent header file. Would there still be a possibility to cover that file as well? Like just checking that the definitions contained there are used elsewhere?