git-filter-repo/t/run_coverage
Elijah Newren effcd5b9ff filter-repo (python3): convert run_coverage
Signed-off-by: Elijah Newren <newren@gmail.com>
2019-05-08 08:57:51 -07:00

29 lines
484 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
python3-coverage combine
python3-coverage html -d $orig_dir/report
python3-coverage report -m
cd $orig_dir
rm -rf $tmpdir