mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-04-19 05:42:15 +03:00
* Makefile.am configure.in tests/Makefile.am tests/*/Makefile.am tests/*/*/Makefile.am: refactored make tests, make all now don't run the test suite * python/Makefile.am: added tests * python/tests/basic.py python/tests/Makefile.am: added the first basic test, memory debug included Daniel
26 lines
566 B
Python
Executable File
26 lines
566 B
Python
Executable File
#!/usr/bin/python -u
|
|
import libxml2
|
|
import libxslt
|
|
|
|
# Memory debug specific
|
|
libxml2.debugMemory(1)
|
|
|
|
|
|
styledoc = libxml2.parseFile("test.xsl")
|
|
style = libxslt.parseStylesheetDoc(styledoc)
|
|
doc = libxml2.parseFile("test.xml")
|
|
result = style.applyStylesheet(doc, None)
|
|
style.saveResultToFilename("foo", result, 0)
|
|
style = None
|
|
doc.freeDoc()
|
|
result.freeDoc()
|
|
|
|
# Memory debug specific
|
|
libxslt.cleanupGlobals()
|
|
libxml2.cleanupParser()
|
|
if libxml2.debugMemory(1) == 0:
|
|
print "OK"
|
|
else:
|
|
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
|
|
libxml2.dumpMemory()
|