1. Build with GCOV enabled
$ cd ~/navigation2_ws/
$ colcon build --symlink-install --packages-select nav2_map_server --cmake-args -DCMAKE_CXX_FLAGS='--coverage' -DCMAKE_C_FLAGS='--coverage'
2. Run testcase manually
$ ./build/nav2_map_server/test/unit/test_costmap_filter_info_server
3. Run LCOV to get html-file
$ lcov --capture --directory build/nav2_map_server/CMakeFiles/map_server_core.dir/src/costmap_filter_info --output-file coverage.info
(in order to get what directory to specify to LCOV I've found required *.gcda file from all file list:
$ find "build/nav2_costmap_2d/" -name "*.gcda")
$ genhtml coverage.info --output-directory out
$ firefox out/index.html
e.g. a more focused version of what @gramss proposed in #87