Skip to content

Commit

Permalink
Better handling of valgrind in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
813gan committed Aug 22, 2024
1 parent 7ee5e35 commit f61275c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/emacspy.h
.mypy_cache
*.pyc
/.valgrind-python.supp
21 changes: 14 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,23 @@ test_ert: all
${EMACS} -batch -l tests/prepare-tests.el -l ert -l tests/test.el \
-f ert-run-tests-batch-and-exit

# https://stackoverflow.com/questions/20112989/how-to-use-valgrind-with-python
test_valgrind: OPTIMALISATION_FLAGS=
test_valgrind: clean all .valgrind-python.supp
PYTHONMALLOC=malloc valgrind --tool=memcheck --suppressions=.valgrind-python.supp \
--leak-check=full --show-leak-kinds=all \
${EMACS} -batch -l tests/prepare-tests.el -l ert -l tests/test.el \
-f ert-run-tests-batch-and-exit

.valgrind-python.supp:
wget -O .valgrind-python.supp \
"https://raw.githubusercontent.com/python/cpython/main/Misc/valgrind-python.supp"
echo "WARNING: Read instructions from top of .valgrind-python.supp"
false

test_formatting:
${CLANGFORMAT} --dry-run --Werror stub.c subinterpreter.c

test_module_assertions: emacspy.so
${EMACS} --batch --module-assertions --eval \
'(progn (add-to-list '\''load-path ".") (load "emacspy"))'

# https://stackoverflow.com/questions/20112989/how-to-use-valgrind-with-python
test_valgrind: OPTIMALISATION_FLAGS=
test_valgrind: clean all
valgrind --tool=memcheck --leak-check=full \
${EMACS} -batch -l tests/prepare-tests.el -l ert -l tests/test.el \
-f ert-run-tests-batch-and-exit

0 comments on commit f61275c

Please sign in to comment.