From 9a67233cd1c6d48c15c773245c240b4a5d419228 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Tue, 18 Oct 2022 13:45:43 -0700 Subject: [PATCH] Store coverage files in .cov directory --- .github/workflows/tests.yml | 2 +- .gitignore | 1 + pyproject.toml | 1 + tests/gdb-tests/tests.sh | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 16f12c19f..bab24d951 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,12 +35,12 @@ jobs: # We use `sudo` for `attachp` command tests - name: Run tests run: | + mkdir .cov PWNDBG_GITHUB_ACTIONS_TEST_RUN=1 sudo --preserve-env ./tests.sh - name: Process coverage data if: matrix.os == 'ubuntu-22.04' run: | - cd tests/gdb-tests coverage combine coverage xml diff --git a/.gitignore b/.gitignore index 2842f2159..13c711ba4 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ +.cov/ .coverage .coverage.* .cache diff --git a/pyproject.toml b/pyproject.toml index d6aaaee05..1d8e828ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,3 +14,4 @@ parallel = true disable_warnings = ["module-not-imported"] source = ["."] omit = ["ida_script.py"] +data_file = ".cov/coverage" diff --git a/tests/gdb-tests/tests.sh b/tests/gdb-tests/tests.sh index 9c0a1263d..81c23343c 100755 --- a/tests/gdb-tests/tests.sh +++ b/tests/gdb-tests/tests.sh @@ -68,7 +68,8 @@ tests_failed=0 for test_case in ${TESTS_LIST}; do gdb_args=(-ex 'py import coverage;coverage.process_startup()' --command $GDB_INIT_PATH --command pytests_launcher.py) - COVERAGE_PROCESS_START=$COVERAGERC_PATH \ + COVERAGE_FILE=$ROOT_DIR/.cov/coverage \ + COVERAGE_PROCESS_START=$COVERAGERC_PATH \ USE_PDB="${USE_PDB}" \ PWNDBG_LAUNCH_TEST="${test_case}" \ PWNDBG_DISABLE_COLORS=1 \