Add a gcov tox environment
This commit is contained in:
parent
844e87fcee
commit
486b2c640d
5 changed files with 26 additions and 10 deletions
12
.gitignore
vendored
12
.gitignore
vendored
|
@ -1,9 +1,11 @@
|
|||
dumb-init
|
||||
dist/
|
||||
*.deb
|
||||
*.egg-info
|
||||
.tox
|
||||
build/
|
||||
__pycache__/
|
||||
*.gc*
|
||||
*.o
|
||||
*.py[cod]
|
||||
.cache
|
||||
.tox
|
||||
__pycache__/
|
||||
build/
|
||||
dist/
|
||||
dumb-init
|
||||
|
|
|
@ -9,14 +9,12 @@ sed -E \
|
|||
-i /etc/apt/sources.list
|
||||
|
||||
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0x5BB92C09DB82666C
|
||||
echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial main' >> /etc/apt/sources.list
|
||||
echo 'deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main' >> /etc/apt/sources.list
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
python2.6-dev \
|
||||
python2.7-dev \
|
||||
python3.5-dev \
|
||||
python3.6-dev
|
||||
|
||||
# We cannot use the Ubuntu versions of tox or virtualenv:
|
||||
|
|
5
ci/gcov-build
Executable file
5
ci/gcov-build
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
envbindir="$1"
|
||||
cc -c dumb-init.c -o dumb-init.o -g --coverage
|
||||
cc dumb-init.o -o "${envbindir}/dumb-init" -g --coverage
|
4
ci/gcov-report
Executable file
4
ci/gcov-report
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
gcov -f dumb-init.c
|
||||
grep '#####' dumb-init.c.gcov | cut -d':' -f2 | xargs echo "Missing:"
|
11
tox.ini
11
tox.ini
|
@ -1,12 +1,19 @@
|
|||
[tox]
|
||||
envlist = py26,py27,py35,py36
|
||||
envlist = py27,py36,gcov
|
||||
|
||||
[testenv]
|
||||
deps = -r{toxinidir}/requirements-dev.txt
|
||||
passenv = HOME SSH_AUTH_SOCK USER
|
||||
passenv = SSH_AUTH_SOCK
|
||||
commands =
|
||||
python -m pytest
|
||||
|
||||
[testenv:gcov]
|
||||
skip_install = True
|
||||
commands =
|
||||
{toxinidir}/ci/gcov-build {envbindir}
|
||||
{[testenv]commands}
|
||||
{toxinidir}/ci/gcov-report
|
||||
|
||||
[testenv:pre-commit]
|
||||
basepython = /usr/bin/python3.6
|
||||
commands = pre-commit {posargs:run --all-files}
|
||||
|
|
Loading…
Reference in a new issue