mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-07-03 00:42:24 +03:00
refactored make tests, make all now don't run the test suite added tests
* 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
This commit is contained in:
25
python/tests/basic.py
Executable file
25
python/tests/basic.py
Executable file
@ -0,0 +1,25 @@
|
||||
#!/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()
|
Reference in New Issue
Block a user