#!/bin/bash

set -e

# Defines the show_installed_libraries and activate_environment functions.
source build_tools/shared.sh

activate_environment

# Combine all coverage files generated by subprocesses workers such
# such as pytest-xdist and joblib/loky:
pushd $TEST_DIR
coverage combine --append
coverage xml
popd

# Copy the combined coverage file to the root of the repository:
cp $TEST_DIR/coverage.xml $BUILD_REPOSITORY_LOCALPATH
