Skip to content

Commit

Permalink
Fix pytest finding librecode DLL on Python >= 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rrthomas committed Mar 12, 2024
1 parent 7012259 commit 9661b3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ DISTCLEANFILES = Recode.c
if HAVE_CYTHON
# TESTS_ENVIRONMENT_EXTRA can be set at configure time
check-local: Recode@pyextext@
export LD_LIBRARY_PATH=$(top_builddir)/src/@objdir@; \
export DYLD_LIBRARY_PATH=$(top_builddir)/src/@objdir@; \
if test "$(PYTHON_PLATFORM)" = win32; then export PATH="$(top_builddir)/src/@objdir@;$$PATH"; fi; \
export SHARED_LIB_DIR=$(abs_top_builddir)/src/@objdir@; \
export LD_LIBRARY_PATH=$$SHARED_LIB_DIR; \
export DYLD_LIBRARY_PATH=$$SHARED_LIB_DIR; \
export LSAN_OPTIONS=$$LSAN_OPTIONS:fast_unwind_on_malloc=0:print_suppressions=0:suppressions=$(srcdir)/asan-suppressions.txt; \
RECODE=$(top_builddir)/src/recode$(EXEEXT) PYTHONPATH=.:$(srcdir) \
$(TESTS_ENVIRONMENT_EXTRA) $(PYTHON) $(srcdir)/pytest $(LIMIT) $(srcdir)/t*.py
Expand Down
3 changes: 3 additions & 0 deletions tests/pytest
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ __metaclass__ = type
import inspect, os, sys, time, traceback
from io import StringIO

if os.name == 'nt':
os.add_dll_directory(os.environ['SHARED_LIB_DIR'])

# How many displayable characters in an output line.
WIDTH = 79

Expand Down

0 comments on commit 9661b3f

Please sign in to comment.