Skip to content

Commit 18e3c7c

Browse files
committed
Use pythondevmode and libasan to detect resource errors
1 parent 9f76885 commit 18e3c7c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tox.ini

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,34 @@ deps=pytest
1010
coverage
1111
passenv=
1212
PYTHON_ZLIB_NG_LINK_DYNAMIC
13+
setenv=
14+
PYTHONDEVMODE=1
1315
commands =
1416
# Create HTML coverage report for humans and xml coverage report for external services.
1517
coverage run --branch --source=zlib_ng -m pytest tests
1618
# Ignore errors during report generation. Pypy does not generate proper coverage reports.
1719
coverage html -i
1820
coverage xml -i
1921

22+
[testenv:asan]
23+
setenv=
24+
PYTHONDEVMODE=1
25+
PYTHONMALLOC=malloc
26+
CFLAGS=-lasan -fsanitize=address -fno-omit-frame-pointer
27+
allowlist_externals=bash
28+
commands=
29+
bash -c 'export LD_PRELOAD=$(gcc -print-file-name=libasan.so) && printenv LD_PRELOAD && python -c "from zlib_ng import zlib_ng" && pytest tests'
30+
31+
[testenv:compliance]
32+
deps=pytest
33+
commands=
34+
pytest -v tests/test_zlib_compliance.py tests/test_gzip_compliance.py
35+
36+
[testenv:compatibility]
37+
deps=pytest
38+
commands=
39+
pytest tests/test_isal.py
40+
2041
[testenv:lint]
2142
deps=flake8
2243
flake8-import-order
@@ -56,21 +77,25 @@ commands=
5677

5778
[testenv:benchmark-all]
5879
deps=
80+
setenv =
5981
commands=
6082
python ./benchmark_scripts/benchmark.py --all
6183

6284
[testenv:benchmark-functions]
6385
deps=
86+
setenv =
6487
commands=
6588
python ./benchmark_scripts/benchmark.py --functions
6689

6790
[testenv:benchmark-gzip]
6891
deps=
92+
setenv =
6993
commands=
7094
python ./benchmark_scripts/benchmark.py --gzip
7195

7296
[testenv:benchmark-checksums]
7397
deps=
98+
setenv =
7499
commands=
75100
python ./benchmark_scripts/benchmark.py --checksums
76101

0 commit comments

Comments
 (0)