Skip to content
Snippets Groups Projects
Commit 146a3442 authored by Millian Poquet's avatar Millian Poquet
Browse files

[ci] nix: coverage script + gcovr package

parent 5ea49cb3
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env nix-shell
#! nix-shell . -i bash -A test_deps_pinned
set -eu
echo "Prepare directories"
rm -rf ./cover
mkdir -p ./cover/tmp
cd ./cover/tmp
echo "Call gcov"
gcov_files=$(find ../../build -name '*.gcda')
for gcov_file in ${gcov_files[@]}; do
gcov ${gcov_file} 1>/dev/null 2>&1
done
echo "Only keep interesting files"
interesting_sources=$(find ../../src -name '*.?pp' | sort | grep -v 'pempek_assert\|taywee_args')
set +e
for interesting_source in ${interesting_sources[@]}; do
interesting_file="./$(basename ${interesting_source}).gcov"
cp -f ${interesting_file} ../ 2>/dev/null
done
set -e
cd ../..
rm -rf ./cover/tmp
echo "Run gcovr analysis (human-readable report)"
gcovr -gk -o ./cover/summary.txt
cat ./cover/summary.txt
echo "Run gcovr analysis (html report)"
rm -rf ./cover/html
mkdir -p ./cover/html
gcovr -gk --html-details -o ./cover/html/index.html
exit 0
......@@ -23,6 +23,7 @@ let
});
batsim_dev = kapack.batsim_dev;
pytest = pkgs.python36Packages.pytest;
gcovr = kapack.gcovr;
# Packages defined in this tree
batsched_local = callPackage ./local.nix {};
......
{ stdenv, batsim, batexpe,
which, redis, procps, psmisc, pytest,
which, redis, procps, psmisc, pytest, gcovr,
nix-prefetch-git
}:
......@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
unpackPhase = "true";
installPhase = "true";
propagatedBuildInputs = [ batsim batexpe
which redis procps psmisc pytest
which redis procps psmisc pytest gcovr
nix-prefetch-git
];
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment