Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial: local test and coverage generation #88

Open
SteveMacenski opened this issue Sep 28, 2020 · 0 comments
Open

Tutorial: local test and coverage generation #88

SteveMacenski opened this issue Sep 28, 2020 · 0 comments

Comments

@SteveMacenski
Copy link
Member

SteveMacenski commented Sep 28, 2020

e.g. a more focused version of what @gramss proposed in #87

  • How to run tests locally and see output (colcon test, test-result --verbose, where to find files in case you want to inspect)
  • How to run code coverage and see report locally (see below)
  • How to build nav2 docs and nav2 website locally and view
  • Elements of testing (unit tests + linters + launch tests) - in another tutorial about how to write / setup tests?
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
@SteveMacenski SteveMacenski changed the title Tutorial for local test and coverage generation Tutorial: local test and coverage generation Oct 13, 2020
gramss added a commit to gramss/navigation.ros.org that referenced this issue Oct 14, 2020
gramss added a commit to gramss/navigation.ros.org that referenced this issue Oct 14, 2020
gramss added a commit to gramss/navigation.ros.org that referenced this issue Nov 9, 2020
gramss added a commit to gramss/navigation.ros.org that referenced this issue Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant