1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-24 21:33:51 +03:00

python: Fix tests on MinGW

Add the directory containing libxml2.dll with os.add_dll_directory to
make tests work on MinGW.

This has changed in Python 3.8 but for some reason, the issue only
turned up with Python 3.11 on MinGW. Contrary to documentation, copying
libxml2.dll into the directory containing the .pyd file doesn't work.
This commit is contained in:
Nick Wellnhofer 2023-08-15 12:49:27 +02:00
parent e2ab48b9b5
commit 138213acdf
49 changed files with 57 additions and 3 deletions

View File

@ -62,8 +62,7 @@ if WITH_PYTHON
check-local:
@for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done
@echo "## running Python regression tests"
@(export PYTHONPATH="..:../.libs:$(srcdir)/..:$$PYTHONPATH" ; \
export LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
@(export LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
export DYLD_LIBRARY_PATH="$(top_builddir)/.libs:$$DYLD_LIBRARY_PATH" ; \
export PATH="$(top_builddir)/.libs:$$PATH" ; \
for test in $(PYTESTS) ; do \

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
import sys

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -4,6 +4,7 @@
# functions defined in Python.
#
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
import sys

View File

@ -4,6 +4,7 @@
# functions defined in Python.
#
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
try:
import StringIO

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
# -*- coding: ISO-8859-1 -*-
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -3,6 +3,7 @@
# This tests custom input callbacks
#
import sys
import setup_test
import libxml2
try:
import StringIO

View File

@ -4,6 +4,7 @@
# allows to detect memory leaks
#
import sys
import setup_test
import libxml2
instance="""<?xml version="1.0"?>

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
try:
import StringIO

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -3,6 +3,7 @@
#
# this tests the basic APIs of the XmlTextReader interface
#
import setup_test
import libxml2
import sys
try:

View File

@ -6,6 +6,7 @@
import sys
import glob
import os
import setup_test
import libxml2
try:
import StringIO

View File

@ -3,6 +3,7 @@
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import setup_test
import libxml2
try:
import StringIO

View File

@ -2,6 +2,7 @@
#
# this tests the basic APIs of the XmlTextReader interface
#
import setup_test
import libxml2
import sys
try:

View File

@ -3,6 +3,7 @@
# this tests the Expand() API of the xmlTextReader interface
# this extract the Dragon bibliography entries from the XML specification
#
import setup_test
import libxml2
import os
import sys

View File

@ -3,6 +3,7 @@
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import setup_test
import libxml2
try:
import StringIO

View File

@ -3,6 +3,7 @@
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -3,6 +3,7 @@
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -2,6 +2,7 @@
#
# this tests the basic APIs of the XmlTextReader interface
#
import setup_test
import libxml2
import sys
try:

View File

@ -3,6 +3,7 @@
#
# this tests the next API of the XmlTextReader interface
#
import setup_test
import libxml2
import sys
try:

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
import sys

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
try:
import StringIO

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
import sys

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -0,0 +1,7 @@
import os
import sys
sys.path += ('..', '../.libs')
if hasattr(os, 'add_dll_directory'):
os.add_dll_directory(os.path.join(os.getcwd(), '..', '..', '.libs'))

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -6,6 +6,7 @@ except:
from thread import get_ident
from threading import Thread, Lock
import setup_test
import libxml2
THREADS_COUNT = 15

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys, unittest
import setup_test
import libxml2
class TestCase(unittest.TestCase):

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
try:

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
#memory debug specific

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
import sys

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
import sys

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import setup_test
import libxml2
import sys

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -3,6 +3,7 @@
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -4,6 +4,7 @@
# allows to detect memory leaks
#
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
# Memory debug specific

View File

@ -1,5 +1,7 @@
#!/usr/bin/env python3
import sys, libxml2
import setup_test
import libxml2
import sys
libxml2.debugMemory(True)

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
#
import setup_test
import libxml2
expect=' xmlns:a="urn:whatevar"'

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import setup_test
import libxml2
#memory debug specific