Debian Codegraph @

tests/Makefile.am

raw
1 # Makefile for Recode regression tests.
2 # Copyright © 1996-2023 Free Software Foundation, Inc.
3 # François Pinard <[email protected]>, 1988.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
8 # any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, see <https://www.gnu.org/licenses/>.
17
18 AUTOMAKE_OPTIONS = gnits
19
20 # LIMIT= may limit testing. For example, "make check LIMIT='-l 1'" stops
21 # testing after the first error, "make check LIMIT='-k utf7' runs files
22 # matched by the "utf7" regexp. Try "./pytest -h" for a list of options.
23
24 SUITE = t21_names.py t22_lists.py t25_subsets.py t30_base64.py \
25 t30_dumps.py t30_quoted.py t40_african.py t40_combine.py t40_testdump.py \
26 t40_utf7.py t40_utf8.py t50_methods.py t90_bigauto.py
27
28 CYTHON = @CYTHON@
29 EXTRA_DIST = Recode.c Recode.pyx pytest common.py asan-suppressions.txt $(SUITE)
30 CLEANFILES = Recode.body.c
31 DISTCLEANFILES = Recode.c
32
33 if HAVE_CYTHON
34 # TESTS_ENVIRONMENT_EXTRA can be set at configure time
35 check-local: Recode@pyextext@
36 export SHARED_LIB_DIR=$(abs_top_builddir)/src/@objdir@; \
37 export LD_LIBRARY_PATH=$$SHARED_LIB_DIR; \
38 export DYLD_LIBRARY_PATH=$$SHARED_LIB_DIR; \
39 export LSAN_OPTIONS=$$LSAN_OPTIONS:fast_unwind_on_malloc=0:print_suppressions=0:suppressions=$(srcdir)/asan-suppressions.txt; \
40 RECODE=$(top_builddir)/src/recode$(EXEEXT) PYTHONPATH=.:$(abs_srcdir) \
41 $(TESTS_ENVIRONMENT_EXTRA) $(PYTHON) $(srcdir)/pytest $(LIMIT) $(srcdir)/t*.py
42
43 Recode@pyextext@: Recode.c setup.py
44 rm -f *@pyextext@
45 $(PYTHON) setup.py build_ext --inplace
46 rm -fr build
47
48 Recode.c: Recode.pyx Makefile
49 rm -f Recode.c && \
50 $(CYTHON) -3 -o Recode.body.c $(srcdir)/Recode.pyx && \
51 echo '#include "config.h"' > Recode.c && \
52 cat Recode.body.c >> Recode.c
53 else
54 check-local:
55 echo "The tests need cython to run!"
56 exit 1
57 endif
58
59 clean-local:
60 rm -rf __pycache__ *@pyextext@