File: run-tests-with-coverage.sh

package info (click to toggle)
cambalache 0.96.0-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,068 kB
  • sloc: python: 17,872; xml: 12,747; sql: 413; ansic: 215; makefile: 196; sh: 35
file content (20 lines) | stat: -rwxr-xr-x 520 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

source .local.env
SCRIPT=$(readlink -f $0)
DIRNAME=$(dirname $SCRIPT)
export GSETTINGS_BACKEND=memory
export HOME=$DIRNAME/.local/home
mkdir -p $HOME/Projects

export COVERAGE_PROCESS_START=$DIRNAME/pyproject.toml

#Run tests with coverage if available
if command -v python3-coverage &> /dev/null
then
  python3-coverage run --rcfile=$DIRNAME/pyproject.toml -m pytest $@
  python3-coverage combine
  python3-coverage report -m
else
  echo "python3-coverage not found;\n sudo apt install python3-coverage"
fi