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:
@ -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 \
|
||||||
|
@ -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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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"?>
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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:
|
||||||
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
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
|
#!/usr/bin/env python3
|
||||||
import sys
|
import sys
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
|
|
||||||
# Memory debug specific
|
# Memory debug specific
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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):
|
||||||
|
@ -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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import setup_test
|
||||||
import libxml2
|
import libxml2
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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"'
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user