From: Steve B. <Ste...@zv...> - 2002-11-01 20:51:42
|
The TclDOM CVS head has some known problems which cause crashes, in particular the event handling code. I'm working on those right now. Also, running the tests is a bit tricky. You have to make sure that the constraints are specified correctly. I'll add a README to the tests directory. Be aware that the libxml2 implementation is not as full-featured as the Tcl implementation - writing C code takes alot more time than writing Tcl code (whoever would have thought? :-) This should change fairly quickly as the waX Me Lyrical project is ramping up and requires a more complete libxml2 package. Finally, the test suite itself needs some work. Not all of the tests pass, but the "failures" often do not indicate a problem with the package itself. A previous message of mine goes into more detail (check the archive), but basically the different modules often serialize their results in different, but legal, ways. For example, <Test attr="value"></Test> is entirely equivalent to <Test attr='value'/> but the test suite will show that as an error because it is doing a character-by-character comparison. HTHs, Steve Ball Larry W. Virden wrote: > when I hand edit and replace the NONE with the right directory > I get a .so file. Then, when I run a > $ make test > > I get: > > $ make test > (echo 'package ifneeded dom::libxml2 2.4 \ > [list load [file join $dir libtcldomxml2.4g.so]]'\ > ) > pkgIndex.tcl > echo load ./libtcldomxml2.4g.so \; cd > /vol/tclsrcsol/tcl84/tcldom/src-libxml2/tests \; source all | > TCL_LIBRARY=`echo /vol/tclsrcsol/tcl84/tcl/library` > LD_LIBRARY_PATH=".:/vol/tcl84binsol/lib:/usr/dt/lib:/usr/openwin/lib:/usr/lib:/cas/lib/sun4" > LIBPATH=".:/vol/tcl84binsol/lib:" SHLIB_PATH=".:/vol/tcl84binsol/lib:" > PATH=".:/vol/tcl84binsol/lib:/opt/SUNWspro/bin:/volws/lwv26/ldatae/bin:/projects/sprs_lwv/sol26/bin:/projects/sprs_lwv/sol26/bin/mime:/projects/sprs_lwv/sol2/bin:/projects/sprs_lwv/bin:/projects/sprs_lwv/bin/mime:/home/lwv26/bin/D.news:/usr/perl5/bin:/projects/gnu/sparc-sun-solaris2.6/bin:/usr/tcl84/bin:/usr/tcl83/bin:/vol/tclsrcsol/TclDevKit/bin:/projects/xopsrc/sun4/bin:/projects/xopsrc/bin:/usr/atria/bin:/projects/intranet/bin:/projects/clearcase/bin:/vol/adobe/Acrobat4.05/bin:/usr/perl5/lib/site_perl/5.005/sun4-solaris/auto/Image/Magick/bin:/opt/sfw/bin:/usr/openwin/demo:/home/lwv26/bin/D.aws:/home/lwv26/bin/sol2:/home/lwv26/bin/D.frontend:/home/lwv26/bin/D.ksh! > :/cas/test/bin/sun4:/projects/sprs > _lwv/bin/sol2:/usr/j2se/bin:/usr/java/bin:/home/lwv26/bin/sun4:/usr/local/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/cas/bin/sun4:/cas/abin/sun4:/cas/X11/sun4/bin:/usr/ccs/bin:/lprod/bin:/usr/sbin:/usr/ucb:/cas/tools/bin/sun4:/cas/X11/sun4/tools/bin:/home/lwv26/bin:/opt/EMCpower/bin:/etc:/cas/tools/pdbin/sun4:/home/lwv26/bin/D.mistypes:/home/lwv26/bin/D.toys:/home/lwv26/bin/D.tools:/projects/npd/npdweb/bin-sol2" > TCLLIBPATH="." /vol/tcl84binsol/lib/../bin/tclsh8.4 > couldn't load file "./libtcldomxml2.4g.so": ld.so.1: > /vol/tcl84binsol/lib/../bin/tclsh8.4: fatal: libxml2.so.2: open > failed: No such file or directory > > The problem here is that the -R flag for the directories into which the > shared libraries resides was not provided during the link. I don't know > the voodoo to get this part right. > > Next, after hand editing the Makefile to get this to work, I try make test > and find that there is no tests directory. So I link the higher level > tests directory into the xml2 directory. I do a make test again and > find that the Makefile tries to "source all" instead of "source all.tcl". > I hand edit that in and get this : > > $ make test > (echo 'package ifneeded dom::libxml2 2.4 \ > [list load [file join $dir libtcldomxml2.4g.so]]'\ > ) > pkgIndex.tcl > echo load ./libtcldomxml2.4g.so \; cd > /vol/tclsrcsol/tcl84/tcldom/src-libxml2/tests \; source all.tcl | > TCL_LIBRARY=`echo /vol/tclsrcsol/tcl84/tcl/library` > LD_LIBRARY_PATH=".:/vol/tcl84binsol/lib:/usr/dt/lib:/usr/openwin/lib:/usr/lib:/cas/lib/sun4" > LIBPATH=".:/vol/tcl84binsol/lib:" SHLIB_PATH=".:/vol/tcl84binsol/lib:" > PATH=".:/vol/tcl84binsol/lib:/opt/SUNWspro/bin:/volws/lwv26/ldatae/bin:/projects/sprs_lwv/sol26/bin:/projects/sprs_lwv/sol26/bin/mime:/projects/sprs_lwv/sol2/bin:/projects/sprs_lwv/bin:/projects/sprs_lwv/bin/mime:/home/lwv26/bin/D.news:/usr/perl5/bin:/projects/gnu/sparc-sun-solaris2.6/bin:/usr/tcl84/bin:/usr/tcl83/bin:/vol/tclsrcsol/TclDevKit/bin:/projects/xopsrc/sun4/bin:/projects/xopsrc/bin:/usr/atria/bin:/projects/intranet/bin:/projects/clearcase/bin:/vol/adobe/Acrobat4.05/bin:/usr/perl5/lib/site_perl/5.005/sun4-solaris/auto/Image/Magick/bin:/opt/sfw/bin:/usr/openwin/demo:/home/lwv26/bin/D.aws:/home/lwv26/bin/sol2:/home/lwv26/bin/D.frontend:/home/lwv26/bin/D! > .ksh:/cas/test/bin/sun4:/projects/ > sprs_lwv/bin/sol2:/usr/j2se/bin:/usr/java/bin:/home/lwv26/bin/sun4:/usr/local/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/cas/bin/sun4:/cas/abin/sun4:/cas/X11/sun4/bin:/usr/ccs/bin:/lprod/bin:/usr/sbin:/usr/ucb:/cas/tools/bin/sun4:/cas/X11/sun4/tools/bin:/home/lwv26/bin:/opt/EMCpower/bin:/etc:/cas/tools/pdbin/sun4:/home/lwv26/bin/D.mistypes:/home/lwv26/bin/D.toys:/home/lwv26/bin/D.tools:/projects/npd/npdweb/bin-sol2" > TCLLIBPATH="." /vol/tcl84binsol/lib/../bin/tclsh8.4 > DOMImplementation.test > Loaded dom version 2.4 via { > if {[catch {package require dom::generic 2.4}]} { > package require dom::tclgeneric > } else { > catch {package require dom::c} > catch {package require dom::libxml2 2.4} > } > package provide dom 2.4 > > # Both the C and pure Tcl versions of the generic layer > # make use of the Tcl implementation. > > package require dom::tcl > } > > ==== DOMImplementation-1.1 hasFeature create FAILED > ==== Contents of test case: > > ::dom::DOMImplementation hasFeature create 1.0 > > ---- Result was: > method "hasFeature" not yet implemented > ---- Result should have been (exact matching): > 1 > ---- Test generated error; Return code was: 1 > ---- Return code should have been one of: 0 2 > ==== DOMImplementation-1.1 FAILED > > > ==== DOMImplementation-1.2 hasFeature create wrong version FAILED > ==== Contents of test case: > > ::dom::DOMImplementation hasFeature create 2.0 > > ---- Result was: > method "hasFeature" not yet implemented > ---- Result should have been (exact matching): > 0 > ---- Test generated error; Return code was: 1 > ---- Return code should have been one of: 0 2 > ==== DOMImplementation-1.2 FAILED > > > ==== DOMImplementation-1.3 hasFeature destroy FAILED > ==== Contents of test case: > > ::dom::DOMImplementation hasFeature destroy 1.0 > > ---- Result was: > method "hasFeature" not yet implemented > ---- Result should have been (exact matching): > 1 > ---- Test generated error; Return code was: 1 > ---- Return code should have been one of: 0 2 > ==== DOMImplementation-1.3 FAILED > > > ==== DOMImplementation-1.4 hasFeature parse FAILED > ==== Contents of test case: > > ::dom::DOMImplementation hasFeature parse 1.0 > > ---- Result was: > method "hasFeature" not yet implemented > ---- Result should have been (exact matching): > 1 > ---- Test generated error; Return code was: 1 > ---- Return code should have been one of: 0 2 > ==== DOMImplementation-1.4 FAILED > > > ==== DOMImplementation-1.5 hasFeature serialize FAILED > ==== Contents of test case: > > ::dom::DOMImplementation hasFeature serialize 1.0 > > ---- Result was: > method "hasFeature" not yet implemented > ---- Result should have been (exact matching): > 1 > ---- Test generated error; Return code was: 1 > ---- Return code should have been one of: 0 2 > ==== DOMImplementation-1.5 FAILED > > > ==== DOMImplementation-1.6 hasFeature unknown feature FAILED > ==== Contents of test case: > > ::dom::DOMImplementation hasFeature unknown 1.0 > > ---- Result was: > method "hasFeature" not yet implemented > ---- Result should have been (exact matching): > 0 > ---- Test generated error; Return code was: 1 > ---- Return code should have been one of: 0 2 > ==== DOMImplementation-1.6 FAILED > > Segmentation Fault - core dumped > make: *** [test] Error 139 > $ dbx $(whence tclsh8.4) ../tests/core > Reading tclsh8.4 > core file header read successfully > Reading ld.so.1 > Reading libtcl8.4g.so > Reading libdl.so.1 > Reading libsocket.so.1 > Reading libnsl.so.1 > Reading libm.so.1 > Reading libc.so.1 > Reading libmp.so.2 > Reading libc_psr.so.1 > Reading libtcldomxml2.4g.so > Reading libxml2.so.2 > Reading libTcldom2.4g.so > Reading libTclxml2.4g.so > program terminated by signal SEGV (no mapping at the fault address) > Current function is HashStringKey > 1021 c = *string; > (dbx 1) where > =>[1] HashStringKey(tablePtr = 0x7ef68, keyPtr = 0x2e657665), line > 1021 in "tclHash.c" > [2] Tcl_FindHashEntry(tablePtr = 0x7ef68, key = 0x2e657665 ""), line > 303 in "tclHash.c" > [3] TclDOMDeleteEvent(clientData = 0xb8e08, objPtr = 0xc0ab8), line > 1063 in "tcldom-libxml2.c" > [4] Tcl_DeleteCommandFromToken(interp = 0x236c0, cmd = 0xbb4b0), > line 2460 in "tclBasic.c" > [5] Tcl_DeleteCommand(interp = 0x236c0, cmdName = 0xc0ab8 > "doc1.event0"), line 2347 in "tclBasic.c" > [6] TclDOMDestroyEvent(event = 0xb8e08, objPtr = 0xd9870), line 1077 > in "tcldom-libxml2.c" > [7] TclDOMEventCommand(clientData = (nil), interp = 0x236c0, objc = > 0, objv = 0xefffa904), line 3993 in "tcldom-libxml2.c" > [8] TclDOMDocumentCommand(dummy = (nil), interp = 0x236c0, objc = 4, > objv = 0xefffab50), line 2178 in "tcldom-libxml2.c" > [9] TclEvalObjvInternal(interp = 0x236c0, objc = 4, objv = > 0xefffab50, command = 0xb1efb "dom::document createElement $doc top]\n > set node1 [dom::document createElement $root node]\n set node2 > [dom::document createElement $root node]\n dom::node removeChild > $root $node1\n dom::DOMImplementation destroy $node1\n\n > dom::DOMImplementation serialize $doc\n", length = 36, flags = 0), > line 3048 in "tclBasic.c" > [10] Tcl_EvalEx(interp = 0x236c0, script = 0xb1efb "dom::document > createElement $doc top]\n set node1 [dom::document createElement > $root node]\n set node2 [dom::document createElement $root node]\n > dom::node removeChild $root $node1\n dom::DOMImplementation > destroy $node1\n\n dom::DOMImplementation serialize $doc\n", > numBytes = 36, flags = 0), line 3647 in "tclBasic.c" > [11] Tcl_EvalTokensStandard(interp = 0x236c0, tokenPtr = 0xefffaf58, > count = 1), line 3362 in "tclBasic.c" > [12] Tcl_EvalEx(interp = 0x236c0, script = 0xb1ec0 "\n set doc > [dom::DOMImplementation create]\n set root [dom::document > createElement $doc top]\n set node1 [dom::document createElement > $root node]\n set node2 [dom::document createElement $root node]\n > dom::node removeChild $root $node1\n dom::DOMImplementation > destroy $node1\n\n dom::DOMImplementation serialize $doc\n", > numBytes = 331, flags = 262144), line 3629 in "tclBasic.c" > [13] Tcl_EvalObjEx(interp = 0x236c0, objPtr = 0xd48e8, flags = > 262144), line 3932 in "tclBasic.c" > [14] Tcl_UplevelObjCmd(dummy = (nil), interp = 0x236c0, objc = 1, > objv = 0x25ad0), line 674 in "tclProc.c" > [15] TclEvalObjvInternal(interp = 0x236c0, objc = 3, objv = 0x25ac8, > command = (nil), length = 0, flags = 0), line 3048 in "tclBasic.c" > [16] TclExecuteByteCode(interp = 0x236c0, codePtr = 0xb7510), line > 1431 in "tclExecute.c" > [17] TclCompEvalObj(interp = 0x236c0, objPtr = 0x4e868), line 1008 > in "tclExecute.c" > [18] TclObjInterpProc(clientData = 0x69780, interp = 0x236c0, objc = > 3, objv = 0xb91b0), line 1082 in "tclProc.c" > [19] TclEvalObjvInternal(interp = 0x236c0, objc = 3, objv = 0xb91b0, > command = 0xef75375c "", length = 0, flags = 262144), line 3048 in > "tclBasic.c" > [20] Tcl_EvalObjv(interp = 0x236c0, objc = 3, objv = 0xb91b0, flags > = 262144), line 3162 in "tclBasic.c" > [21] Tcl_EvalObjEx(interp = 0x236c0, objPtr = 0xd49a8, flags = > 262144), line 3929 in "tclBasic.c" > [22] Tcl_UplevelObjCmd(dummy = (nil), interp = 0x236c0, objc = 1, > objv = 0x25ac4), line 674 in "tclProc.c" > [23] TclEvalObjvInternal(interp = 0x236c0, objc = 3, objv = 0x25abc, > command = (nil), length = 0, flags = 0), line 3048 in "tclBasic.c" > [24] TclExecuteByteCode(interp = 0x236c0, codePtr = 0xb2510), line > 1431 in "tclExecute.c" > [25] TclCompEvalObj(interp = 0x236c0, objPtr = 0x4a1c0), line 1008 > in "tclExecute.c" > [26] TclObjInterpProc(clientData = 0x694d8, interp = 0x236c0, objc = > 3, objv = 0xcf868), line 1082 in "tclProc.c" > [27] TclEvalObjvInternal(interp = 0x236c0, objc = 3, objv = 0xcf868, > command = 0xef75375c "", length = 0, flags = 262144), line 3048 in > "tclBasic.c" > [28] Tcl_EvalObjv(interp = 0x236c0, objc = 3, objv = 0xcf868, flags > = 262144), line 3162 in "tclBasic.c" > [29] Tcl_EvalObjEx(interp = 0x236c0, objPtr = 0xd4390, flags = > 262144), line 3929 in "tclBasic.c" > [30] Tcl_UplevelObjCmd(dummy = (nil), interp = 0x236c0, objc = 1, > objv = 0x25ab8), line 674 in "tclProc.c" > [31] TclEvalObjvInternal(interp = 0x236c0, objc = 3, objv = 0x25ab0, > command = (nil), length = 0, flags = 0), line 3048 in "tclBasic.c" > [32] TclExecuteByteCode(interp = 0x236c0, codePtr = 0xb49c0), line > 1431 in "tclExecute.c" > [33] TclCompEvalObj(interp = 0x236c0, objPtr = 0x51050), line 1008 > in "tclExecute.c" > [34] TclObjInterpProc(clientData = 0x696e0, interp = 0x236c0, objc = > 9, objv = 0xefffcb98), line 1082 in "tclProc.c" > [35] InvokeImportedCmd(clientData = 0x637c8, interp = 0x236c0, objc > = 9, objv = 0xefffcb98), line 1478 in "tclNamesp.c" > [36] TclEvalObjvInternal(interp = 0x236c0, objc = 9, objv = > 0xefffcb98, command = 0x7f999 "# Bug fix #453741\ntest > DOMImplementation-3.5 {destroy an element node} -match regexp -body > {\n set doc [dom::DOMImplementation create]\n set root > [dom::document createElement $doc top]\n set node1 [dom::document > createElement $root node]\n set node2 [dom::document createElement > $root node]\n dom::node removeChild $root $node1\n > dom::DOMImplementation destroy $node1\n\n dom::DOMImplementation > serialize $doc\n} -result {<\?xml > version=("|')1\.0("|')\?>\n\n}\n\nset ::tcl" ..., length = 502, flags > = 0), line 3048 in "tclBasic.c" > [37] Tcl_EvalEx(interp = 0x236c0, script = 0x7efb0 "# Commands > covered: ::dom::DOMImplementation\n#\n# This file contains a > collection of tests for one or more of the \n# TclDOM commands. > Sourcing this file into Tcl runs the tests and\n# generates output for > errors. No output means no errors were found.\n#\n# Copyright (c) > 1998 Zveno Pty Ltd.\n#\n# $Id: DOMImplementation.test,v 1.7 2002/08/30 > 07:49:55 balls Exp $\n\npackage require tcltest ; namespace import > -force ::tcltest::*\nsource testutils.tcl\ntestPackage dom\n\ntest > DOMImplementation-1.1 {hasFeature create} -bo" ..., numBytes = 3670, > flags = 0), line 3647 in "tclBasic.c" > [38] Tcl_FSEvalFile(interp = 0x236c0, pathPtr = 0x6c1e8), line 1371 > in "tclIOUtil.c" > [39] Tcl_SourceObjCmd(dummy = (nil), interp = 0x236c0, objc = 2, > objv = 0x25aa8), line 1032 in "tclCmdMZ.c" > [40] TclEvalObjvInternal(interp = 0x236c0, objc = 2, objv = 0x25aa8, > command = (nil), length = 0, flags = 0), line 3048 in "tclBasic.c" > [41] TclExecuteByteCode(interp = 0x236c0, codePtr = 0x7c7c8), line > 1431 in "tclExecute.c" > [42] TclCompEvalObj(interp = 0x236c0, objPtr = 0x4a298), line 1008 > in "tclExecute.c" > [43] Tcl_EvalObjEx(interp = 0x236c0, objPtr = 0x4a298, flags = 0), > line 3944 in "tclBasic.c" > [44] Tcl_CatchObjCmd(dummy = (nil), interp = 0x236c0, objc = 3, objv > = 0x25a9c), line 254 in "tclCmdAH.c" > [45] TclEvalObjvInternal(interp = 0x236c0, objc = 3, objv = 0x25a9c, > command = (nil), length = 0, flags = 0), line 3048 in "tclBasic.c" > [46] TclExecuteByteCode(interp = 0x236c0, codePtr = 0x7c6a8), line > 1431 in "tclExecute.c" > [47] TclCompEvalObj(interp = 0x236c0, objPtr = 0x542e8), line 1008 > in "tclExecute.c" > [48] Tcl_EvalObjEx(interp = 0x236c0, objPtr = 0x542e8, flags = 0), > line 3944 in "tclBasic.c" > [49] Tcl_ForeachObjCmd(dummy = (nil), interp = 0x236c0, objc = 4, > objv = 0xefffd948), line 1858 in "tclCmdAH.c" > [50] TclEvalObjvInternal(interp = 0x236c0, objc = 4, objv = > 0xefffd948, command = 0x734db "\n# source each of the specified > tests\nforeach file [lsort [::tcltest::getMatchingFiles]] {\n^Iset > tail [file tail $file]\n^Iputs stdout $tail\n^Iif {[catch {source > $file} msg]} {\n^I^Iputs stdout $msg\n^I}\n}\n\n# > cleanup\n::tcltest::cleanupTests 1\nreturn\n", length = 197, flags = > 0), line 3048 in "tclBasic.c" > [51] Tcl_EvalEx(interp = 0x236c0, script = 0x73328 "# This file > contains a top-level script to run all of the Tcl\n# tests. Execute > it by invoking "source all" when running tclTest\n# in this > directory.\n#\n# Copyright (c) 2000 Ajuba Solutions\n#\n# SCCS: @(#) > all 1.8 97/08/01 11:07:14\n\nif {[lsearch [namespace children] > ::tcltest] == -1} {\n^Ipackage require tcltest\n^Inamespace import > ::tcltest::*\n}\n\nset ::tcltest::testSingleFile false\nset > ::tcltest::testsDirectory [file dir [info script]]\n\n# source each of > the specified tests\nforeach file [lsort [::tcltest::getMatc" ..., > numBytes = 676, flags = 0), line 3647 in "tclBasic.c" > [52] Tcl_FSEvalFile(interp = 0x236c0, pathPtr = 0x45ef8), line 1371 > in "tclIOUtil.c" > [53] Tcl_SourceObjCmd(dummy = (nil), interp = 0x236c0, objc = 2, > objv = 0x25a94), line 1032 in "tclCmdMZ.c" > [54] TclEvalObjvInternal(interp = 0x236c0, objc = 2, objv = 0x25a94, > command = (nil), length = 0, flags = 0), line 3048 in "tclBasic.c" > [55] TclExecuteByteCode(interp = 0x236c0, codePtr = 0x43520), line > 1431 in "tclExecute.c" > [56] TclCompEvalObj(interp = 0x236c0, objPtr = 0x2bf28), line 1008 > in "tclExecute.c" > [57] Tcl_EvalObjEx(interp = 0x236c0, objPtr = 0x2bf28, flags = > 131072), line 3944 in "tclBasic.c" > [58] Tcl_RecordAndEvalObj(interp = 0x236c0, cmdPtr = 0x2bf28, flags > = 131072), line 142 in "tclHistory.c" > [59] Tcl_Main(argc = 1, argv = 0xefffe3ac, appInitProc = 0x109e0 = > &Tcl_AppInit(Tcl_Interp *interp)), line 390 in "tclMain.c" > [60] main(argc = 1, argv = 0xefffe3ac), line 90 in "tclAppInit.c" > (dbx 2) -- Steve Ball | XSLT Standard Library | Training & Seminars Zveno Pty Ltd | Web Tcl Complete | XML XSL Schemas http://www.zveno.com/ | TclXML TclDOM | Tcl, Web Development Ste...@zv... +---------------------------+--------------------- Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 6242 4099 |