Skip to content

Commit 22e32a2

Browse files
committed
nox: add coverage
1 parent e1e0aeb commit 22e32a2

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

checksec/utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from pathlib import Path
88

99
import lddwrap
10-
1110
# cannot use is_elf because of circular dependency
1211
import lief
1312

noxfile.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,23 @@ def test_unit(session):
3636
args = session.posargs
3737
session.install("-r", "requirements.txt")
3838
session.install("pytest==6.0.2", "coverage==5.3")
39-
session.run("coverage", "run", "-m", "pytest", "-v", "-k", "unit", *args)
39+
session.run("coverage", "run", "--concurrency=multiprocessing", "-m", "pytest", "-v", "-k", "unit", *args)
40+
session.run("coverage", "combine")
41+
session.run("coverage", "report")
4042

4143

4244
@nox.session
4345
def test_e2e(session):
4446
args = session.posargs
4547
session.install(".")
4648
session.install("pytest==6.0.2", "coverage==5.3")
47-
session.run("coverage", "run", "-m", "pytest", "-v", "-k", "e2e", *args)
49+
session.run("coverage", "run", "--concurrency=multiprocessing", "-m", "pytest", "-v", "-k", "e2e", *args)
50+
session.run("coverage", "combine")
51+
session.run("coverage", "report")
52+
53+
54+
@nox.session
55+
def coverage(session):
56+
args = session.posargs if session.posargs else ["report"]
57+
session.install("coverage==5.3")
58+
session.run("coverage", *args)

setup.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@ max-line-length=120
33
exclude = .git, .nox, venv, build, dist
44
# black compatibility
55
extend-ignore = E203
6+
7+
[coverage:run]
8+
# measure branch coverage in addition to statement coverage
9+
branch = True
10+
# restrict measurement to avoid .nox/*
11+
source =
12+
checksec

0 commit comments

Comments
 (0)