1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-02 04:21:55 +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: check-local:
@for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done @for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done
@echo "## running Python regression tests" @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 DYLD_LIBRARY_PATH="$(top_builddir)/.libs:$$DYLD_LIBRARY_PATH" ; \
export PATH="$(top_builddir)/.libs:$$PATH" ; \ export PATH="$(top_builddir)/.libs:$$PATH" ; \
for test in $(PYTESTS) ; do \ for test in $(PYTESTS) ; do \

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys import sys
import setup_test
import libxml2 import libxml2
# Memory debug specific # 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 #!/usr/bin/env python3
import sys import sys
import setup_test
import libxml2 import libxml2
# Memory debug specific # Memory debug specific

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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