git-filter-repo/t/run_coverage
Elijah Newren 0e4d48158f filter-repo: add a script to generate a line coverage report
This also generates line coverage statistics for t/t9391/*.py, but the
point is line coverage of git-filter-repo.

Signed-off-by: Elijah Newren <newren@gmail.com>
2019-04-29 09:56:38 -07:00

29 lines
481 B
Bash
Executable File

#!/bin/bash
orig_dir=$(cd $(dirname $0) && pwd -P)
tmpdir=$(mktemp -d)
cat <<EOF >$tmpdir/.coveragerc
[run]
parallel=true
data_file=$tmpdir/.coverage
EOF
cat <<EOF >$tmpdir/sitecustomize.py
import coverage
coverage.process_startup()
EOF
export COVERAGE_PROCESS_START=$tmpdir/.coveragerc
export PYTHONPATH=$tmpdir:
ls t939*.sh | xargs -n 1 bash
cd $tmpdir
python-coverage combine
python-coverage html -d $orig_dir/report
python-coverage report -m
cd $orig_dir
rm -rf $tmpdir