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:
parent
e2ab48b9b5
commit
138213acdf
@ -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 \
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -4,6 +4,7 @@
|
||||
# functions defined in Python.
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
# functions defined in Python.
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
try:
|
||||
import StringIO
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: ISO-8859-1 -*-
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -3,6 +3,7 @@
|
||||
# This tests custom input callbacks
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
try:
|
||||
import StringIO
|
||||
|
@ -4,6 +4,7 @@
|
||||
# allows to detect memory leaks
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
instance="""<?xml version="1.0"?>
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
try:
|
||||
import StringIO
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -3,6 +3,7 @@
|
||||
#
|
||||
# this tests the basic APIs of the XmlTextReader interface
|
||||
#
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
try:
|
||||
|
@ -6,6 +6,7 @@
|
||||
import sys
|
||||
import glob
|
||||
import os
|
||||
import setup_test
|
||||
import libxml2
|
||||
try:
|
||||
import StringIO
|
||||
|
@ -3,6 +3,7 @@
|
||||
# this tests the entities substitutions with the XmlTextReader interface
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
try:
|
||||
import StringIO
|
||||
|
@ -2,6 +2,7 @@
|
||||
#
|
||||
# this tests the basic APIs of the XmlTextReader interface
|
||||
#
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
try:
|
||||
|
@ -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
|
||||
|
@ -3,6 +3,7 @@
|
||||
# this tests the entities substitutions with the XmlTextReader interface
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
try:
|
||||
import StringIO
|
||||
|
@ -3,6 +3,7 @@
|
||||
# this tests the entities substitutions with the XmlTextReader interface
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -3,6 +3,7 @@
|
||||
# this tests the entities substitutions with the XmlTextReader interface
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -2,6 +2,7 @@
|
||||
#
|
||||
# this tests the basic APIs of the XmlTextReader interface
|
||||
#
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
try:
|
||||
|
@ -3,6 +3,7 @@
|
||||
#
|
||||
# this tests the next API of the XmlTextReader interface
|
||||
#
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
try:
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
try:
|
||||
import StringIO
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
7
python/tests/setup_test.py
Normal file
7
python/tests/setup_test.py
Normal 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'))
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -6,6 +6,7 @@ except:
|
||||
from thread import get_ident
|
||||
from threading import Thread, Lock
|
||||
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
THREADS_COUNT = 15
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys, unittest
|
||||
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
try:
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
#memory debug specific
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -3,6 +3,7 @@
|
||||
# this tests the entities substitutions with the XmlTextReader interface
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -4,6 +4,7 @@
|
||||
# allows to detect memory leaks
|
||||
#
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys, libxml2
|
||||
import setup_test
|
||||
import libxml2
|
||||
import sys
|
||||
|
||||
libxml2.debugMemory(True)
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
expect=' xmlns:a="urn:whatevar"'
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import setup_test
|
||||
import libxml2
|
||||
|
||||
#memory debug specific
|
||||
|
Loading…
Reference in New Issue
Block a user