diff --git a/industrial_ci/src/tests/source_tests.sh b/industrial_ci/src/tests/source_tests.sh index 3ee8e8c25..ffd2edb29 100644 --- a/industrial_ci/src/tests/source_tests.sh +++ b/industrial_ci/src/tests/source_tests.sh @@ -97,7 +97,7 @@ function run_clang_tidy_check { fi } -function run_lcov { +function ici_combine_cpp_reports { ici_install_pkgs_for_command lcov lcov local target_ws=$1 cd "$target_ws" || return 1 @@ -120,6 +120,31 @@ function run_lcov { # Filter out test files lcov --remove coverage.info "*/test/*" \ --output-file coverage.info | grep -ve "^removing" + lcov --list coverage.info +} + +function ici_combine_python_reports { + ici_install_pkgs_for_command coverage python3-coverage python3-dev python3-wheel + local target_ws=$1 + cd "$target_ws" || return 1 + # Find all .coverage file + IFS=" " read -r -a python_reports <<< \ + "$(find "$target_ws/build" \ + -type f \ + -name ".coverage" \ + -printf "%p ")" + # Copy coverage file into workspace and + # convert names from .coverage to .coverage.0/1/2 + local arraylength=${#python_reports[@]} + for (( i=1; i coverage.c.json - cp "${pytest_reports[0]}" . coveralls-merge coverage.c.json - esac - - + cd "$target_ws" || return 1 } function run_source_tests {