Skip to content

Commit f9e202a

Browse files
committed
debug: misc improvements to debugging
1 parent 2d9d6d1 commit f9e202a

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ help: ## Show this help.
1515
@echo Available targets:
1616
@awk -F ':.*##' '/^[^: ]+:.*##/{printf " \033[1m%-20s\033[m %s\n",$$1,$$2} /^##@/{printf "\n%s\n",substr($$0,5)}' $(MAKEFILE_LIST)
1717

18-
clean_platform:
18+
_clean_platform:
1919
@rm -f *.so */*.so
2020
@rm -f *.pyd */*.pyd
2121
@rm -rf __pycache__ */__pycache__ */*/__pycache__ */*/*/__pycache__ */*/*/*/__pycache__ */*/*/*/*/__pycache__
2222
@rm -f *.pyc */*.pyc */*/*.pyc */*/*/*.pyc */*/*/*/*.pyc */*/*/*/*/*.pyc
2323
@rm -f *.pyo */*.pyo */*/*.pyo */*/*/*.pyo */*/*/*/*.pyo */*/*/*/*/*.pyo
2424
@rm -f *$$py.class */*$$py.class */*/*$$py.class */*/*/*$$py.class */*/*/*/*$$py.class */*/*/*/*/*$$py.class
2525

26-
clean: clean_platform ## Remove artifacts of test execution, installation, etc.
26+
debug_clean: ## Delete various debugging artifacts.
27+
@rm -rf /tmp/dis $$COVERAGE_DEBUG_FILE
28+
29+
clean: debug_clean _clean_platform ## Remove artifacts of test execution, installation, etc.
2730
@echo "Cleaning..."
2831
@-pip uninstall -yq coverage
2932
@mkdir -p build # so the chmod won't fail if build doesn't exist

coverage/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,11 @@ def read_coverage_config(
600600
if specified_file:
601601
raise ConfigError(f"Couldn't read {fname!r} as a config file")
602602

603-
# $set_env.py: COVERAGE_DEBUG - Options for --debug.
604603
# 3) from environment variables:
605604
env_data_file = os.getenv("COVERAGE_FILE")
606605
if env_data_file:
607606
config.data_file = env_data_file
607+
# $set_env.py: COVERAGE_DEBUG - Debug options: https://coverage.rtfd.io/cmd.html#debug
608608
debugs = os.getenv("COVERAGE_DEBUG")
609609
if debugs:
610610
config.debug.extend(d.strip() for d in debugs.split(","))

coverage/debug.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ def get_one(
446446
if file_name is not None:
447447
fileobj = open(file_name, "a", encoding="utf-8")
448448
else:
449+
# $set_env.py: COVERAGE_DEBUG_FILE - Where to write debug output
449450
file_name = os.getenv("COVERAGE_DEBUG_FILE", FORCED_DEBUG_FILE)
450451
if file_name in ("stdout", "stderr"):
451452
fileobj = getattr(sys, file_name)

lab/pick.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
1818
as in::
1919
20-
te py311 -- -vvv -n 0 --select-cmd="python lab/pick.py sample 10 < tests.txt"
20+
te py311 -- -vvv -n 0 --cache-clear --select-cmd="python lab/pick.py sample 10 < tests.txt"
2121
2222
or::
2323
24-
for n in 1 1 2 2 3 3; do te py311 -- -vvv -n 0 --select-cmd="python lab/pick.py sample 3 $n < tests.txt"; done
24+
for n in 1 1 2 2 3 3; do te py311 -- -vvv -n 0 --cache-clear --select-cmd="python lab/pick.py sample 3 $n < tests.txt"; done
2525
2626
or::
2727
28-
for n in $(seq 1 10); do echo seed=$n; COVERAGE_COVERAGE=yes te py311 -- -n 0 --select-cmd="python lab/pick.py sample 20 $n < tests.txt"; done
28+
for n in $(seq 1 10); do echo seed=$n; COVERAGE_COVERAGE=yes te py311 -- -n 0 --cache-clear --select-cmd="python lab/pick.py sample 20 $n < tests.txt"; done
2929
3030
"""
3131

0 commit comments

Comments
 (0)