mirror of
https://github.com/rust-vmm/rust-vmm-ci.git
synced 2026-08-05 03:08:31 +00:00
Add a flag that saves the coverage output dir
This commit adds a pytest command line option `--no-cleanup` for the coverage test. Running the coverage test with this option will let users save the `kcov_output` directory so that it is easier to inspect the coverage report. Signed-off-by: Henry Wang <henry.wang@arm.com>
This commit is contained in:
@@ -17,6 +17,13 @@ def pytest_addoption(parser):
|
||||
PROFILE_DEVEL
|
||||
)
|
||||
)
|
||||
parser.addoption(
|
||||
"--no-cleanup",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Keep the coverage report in `kcov_output` directory. If this flag is not provided, "
|
||||
"both coverage related directories are removed."
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -24,6 +31,11 @@ def profile(request):
|
||||
return request.config.getoption("--profile")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def no_cleanup(request):
|
||||
return request.config.getoption("--no-cleanup")
|
||||
|
||||
|
||||
# This is used for defining global variables in pytest.
|
||||
def pytest_configure():
|
||||
pytest.profile_ci = PROFILE_CI
|
||||
|
||||
Reference in New Issue
Block a user