diff --git a/industrial_ci/src/coverage.sh b/industrial_ci/src/coverage.sh index 3b7f5aed6..dde106ef4 100644 --- a/industrial_ci/src/coverage.sh +++ b/industrial_ci/src/coverage.sh @@ -36,7 +36,9 @@ function ici_combine_cpp_reports { lcov --extract coverage.info "$(pwd)/src/$TARGET_REPO_NAME/*" \ --output-file coverage.info | grep -ve "^Extracting" # Filter out test files - lcov --remove coverage.info "*/test/*" \ + local excludes=() + ici_parse_env_array excludes CODE_COVERAGE_EXCLUDES + lcov --remove coverage.info "*/test/*" "${excludes[@]}" \ --output-file coverage.info | grep -ve "^removing" # Some sed magic to remove identifiable absolute path sed -i "s~$(pwd)/src/$TARGET_REPO_NAME/~~g" coverage.info @@ -77,7 +79,7 @@ function ici_collect_coverage_report { "${PYTHON_VERSION_NAME}-dev" "${PYTHON_VERSION_NAME}-wheel" "${PYTHON_VERSION_NAME}" -m pip install coveralls # Use coveragerc file used for coveralls ignore - printf "[report]\ninclude = \n\t%s/src/%s/*\nomit = \n\t*/test/*\n\t*/setup.py" "$target_ws" "$TARGET_REPO_NAME" \ + printf "[report]\ninclude = \n\t%s/src/%s/*\nomit = \n\t*/test/*\n\t*/setup.py\n\t%s" "$target_ws" "$TARGET_REPO_NAME" "${CODE_COVERAGE_EXCLUDES/ /\\t\\n}" \ > "$target_ws/src/$TARGET_REPO_NAME/.default.coveragerc" if [ -f "$target_ws"/coverage.info ]; then # Install and run coveralls-lcov within git directory diff --git a/industrial_ci/src/env.sh b/industrial_ci/src/env.sh index 8b78daf14..a9e69e54d 100644 --- a/industrial_ci/src/env.sh +++ b/industrial_ci/src/env.sh @@ -60,6 +60,7 @@ export CCACHE_DIR=${CCACHE_DIR:-} export CMAKE_ARGS=${CMAKE_ARGS:-} export CODE_COVERAGE=${CODE_COVERAGE:-} +export CODE_COVERAGE_EXCLUDES=${CODE_COVERAGE_EXCLUDES:-} export DOWNSTREAM_CMAKE_ARGS=${DOWNSTREAM_CMAKE_ARGS:-} export DOWNSTREAM_WORKSPACE=${DOWNSTREAM_WORKSPACE:-} diff --git a/industrial_ci/src/isolation/docker.env b/industrial_ci/src/isolation/docker.env index 8bd371ace..aeb0c6eb8 100644 --- a/industrial_ci/src/isolation/docker.env +++ b/industrial_ci/src/isolation/docker.env @@ -19,6 +19,7 @@ CLANG_TIDY_BASE_REF CLANG_TIDY_JOBS CMAKE_ARGS CODE_COVERAGE +CODE_COVERAGE_EXCLUDES CPPFLAGS CXX CXXFLAGS