From 2e28e23a4beb5db06dbdd0849ad4a90e781eb40c Mon Sep 17 00:00:00 2001
From: Carl Delsey <carl.r.delsey@intel.com>
Date: Thu, 14 Nov 2019 16:51:38 -0800
Subject: [PATCH] Attempt to filter out generated message files from code
 coverage. (#1340)

* Attempt to filter out generated message files from code coverage.

* Reduce the number of tests run in Travis to just a single test.

* Filter specific msg packages instead of ros_idl... directories.

* Fixing a typo in the nav_2d_msgs package name.
---
 tools/code_coverage_report.bash |  8 +++++++-
 tools/run_test_suite.bash       | 12 ++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/tools/code_coverage_report.bash b/tools/code_coverage_report.bash
index 54569365..d4ff3d7f 100755
--- a/tools/code_coverage_report.bash
+++ b/tools/code_coverage_report.bash
@@ -71,6 +71,12 @@ lcov \
 lcov \
   --remove ${LCOVDIR}/workspace_coverage.info \
     "${PWD}/build/*" \
+  --remove ${LCOVDIR}/workspace_coverage.info \
+    "${PWD}/*/dwb_msgs/*" \
+  --remove ${LCOVDIR}/workspace_coverage.info \
+    "${PWD}/*/nav2_msgs/*" \
+  --remove ${LCOVDIR}/workspace_coverage.info \
+    "${PWD}/*/nav_2d_msgs/*" \
   --output-file ${LCOVDIR}/project_coverage.info \
   --rc lcov_branch_coverage=1
 
@@ -82,4 +88,4 @@ elif [ $COVERAGE_REPORT_VIEW = genhtml ]; then
   genhtml ${LCOVDIR}/project_coverage.info \
     --output-directory ${LCOVDIR}/html \
     --branch-coverage -p ${PWD}
-fi
\ No newline at end of file
+fi
diff --git a/tools/run_test_suite.bash b/tools/run_test_suite.bash
index b4e2c45a..51323c56 100755
--- a/tools/run_test_suite.bash
+++ b/tools/run_test_suite.bash
@@ -19,10 +19,10 @@ colcon test --packages-select nav2_system_tests --ctest-args --exclude-regex "te
 # that happened in any of the `colcon test` lines above.
 colcon test-result --verbose
 
-$SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_localization$
-$SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_planner_costmaps$
-$SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_planner_random$
-$SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_bt_navigator$
-$SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_bt_navigator_with_dijkstra$
+# $SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_localization$
+# $SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_planner_costmaps$
+# $SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_planner_random$
+# $SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_bt_navigator$
+# $SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_bt_navigator_with_dijkstra$
 $SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_dynamic_obstacle$
-$SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_multi_robot$
+# $SCRIPT_DIR/ctest_retry.bash -r 3 -d build/nav2_system_tests -t test_multi_robot$
-- 
GitLab