From eb18b04e54b6cd76d659b845c6638637cf4fea65 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Tue, 18 Oct 2022 15:41:53 -0700 Subject: [PATCH] fix coverage generation --- pyproject.toml | 5 ++++- tests/gdb-tests/tests.sh | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1d8e828ce..311b17e9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,9 @@ extend_skip_glob = ["gdb-pt-dump/*"] branch = true parallel = true disable_warnings = ["module-not-imported"] -source = ["."] +source = ["${SRC_DIR-.}"] omit = ["ida_script.py"] data_file = ".cov/coverage" + +[tool.coverage.report] +omit = ["ida_script.py", "tests/*"] diff --git a/tests/gdb-tests/tests.sh b/tests/gdb-tests/tests.sh index 81c23343c..25ca86af5 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_FILE=$ROOT_DIR/.cov/coverage \ + SRC_DIR=$ROOT_DIR \ + COVERAGE_FILE=$ROOT_DIR/.cov/coverage \ COVERAGE_PROCESS_START=$COVERAGERC_PATH \ USE_PDB="${USE_PDB}" \ PWNDBG_LAUNCH_TEST="${test_case}" \