From luca at pca.it Sat May 13 18:59:52 2006 From: luca at pca.it (Luca Capello) Date: Sat, 13 May 2006 13:59:52 -0500 Subject: [s-xml-devel] Problem when loading the tests with the CLC Message-ID: <873bfdwy1j.fsf@gismo.pca.it> Hello, I've a problem when I try to load the tests suite. First of all, on the Debian package I maintain [1] uses clc, the Common Lisp Controller [2]. Thus, it installs files in /usr/share/common-lisp/source/[package] For I don't know which strange reason, I didn't included the test suite in the previous Debian versions, so I'm doing it for the next one (which will include also a new CVS checkout). I created a second ASDF system which loads the test, instead of $ sbcl --load /usr/share/common-lisp/source/s-xml/test/all-tests.lisp --8<---------------cut here---------------start------------->8--- Index: s-xml.asd =================================================================== RCS file: /project/s-xml/cvsroot/s-xml/s-xml.asd,v retrieving revision 1.2 diff -u -r1.2 s-xml.asd --- s-xml.asd 14 Dec 2005 21:49:04 -0000 1.2 +++ s-xml.asd 13 May 2006 18:36:04 -0000 @@ -31,4 +31,14 @@ (:file "sxml-dom" :depends-on ("dom")) (:file "xml-struct-dom" :depends-on ("dom")))))) +(defsystem :s-xml.test + :depends-on (:s-xml) + :components + ((:module + :test + :components ((:file "test-xml") + (:file "test-xml-struct-dom") + (:file "test-lxml-dom") + (:file "test-sxml-dom"))))) + ;;;; eof --8<---------------cut here---------------end--------------->8--- If it won't be included upstream I'll probably get it in the Debian package anyway, but only after having found the best solution to the whole problem. With the above patch, I got various errors: ===== $ sbcl $ * (asdf:oos 'asdf:load-op 's-xml) $ * (asdf:oos 'asdf:load-op 's-xml.test) [...] ; /var/cache/common-lisp-controller/1000/sbcl/s-xml/test/test-sxml-dom.fasl written ; compilation finished in 0:00:00 debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread #: error opening #P"/var/cache/common-lisp-controller/1000/sbcl/s-xml/test/xhtml-page.xml": No such file or directory * (quit) ===== So, the problem is *load-pathname* and I cannot find something like *source-pathname* :-( One possible solution is the following, but it ASDF-specific: --8<---------------cut here---------------start------------->8--- Index: test/test-xml-struct-dom.lisp =================================================================== RCS file: /project/s-xml/cvsroot/s-xml/test/test-xml-struct-dom.lisp,v retrieving revision 1.2 diff -u -r1.2 test-xml-struct-dom.lisp --- test/test-xml-struct-dom.lisp 29 Aug 2005 15:01:49 -0000 1.2 +++ test/test-xml-struct-dom.lisp 13 May 2006 18:48:08 -0000 @@ -44,8 +44,13 @@ " text, with a leading & trailing space ")))) (assert - (xml-element-p (parse-xml-file (merge-pathnames "xhtml-page.xml" *load-pathname*) - :output-type :xml-struct))) + (xml-element-p (parse-xml-file + (merge-pathnames + "test/xhtml-page.xml" + (truename + (asdf:component-pathname + (asdf:find-system :s-xml.test)))) + :output-type :xml-struct))) (assert (xml-element-p (parse-xml-file (merge-pathnames "ant-build-file.xml" *load-pathname*) --8<---------------cut here---------------end--------------->8--- Obviously, this should be done every time we parse an XML-file, so it's going to be quite a big modification. Moreover, as I said, this is ASDF-specific, thus I'm asking for help in order to find a more general solution. In case nothing will be found, we can use #+common-lisp-controller or I can patch s-xml only for Debian (which would be absolutely fine, but I'll still prefer a general solution). Thx, bye, Gismo / Luca [1] http://packages.debian.org/cl-s-xml [2] http://www.cliki.net/common-lisp-controller -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From sven at beta9.be Sun May 14 20:32:53 2006 From: sven at beta9.be (Sven Van Caekenberghe) Date: Sun, 14 May 2006 22:32:53 +0200 Subject: [s-xml-devel] Problem when loading the tests with the CLC In-Reply-To: <873bfdwy1j.fsf@gismo.pca.it> References: <873bfdwy1j.fsf@gismo.pca.it> Message-ID: Luca, The test suite was designed to be loaded and not compiled - that way, *load-pathname* is correct with respect to the needed test resources files. Of course it would be a good idea to make an asdf of the test suite, and use it properly. I am not sure what the correct solution is. What do other CL projects do in similar cases ? Isn't there a way to prevent asdf from compiling certain files - maybe that could be a solution ? Sven On 13 May 2006, at 20:59, Luca Capello wrote: > Hello, > > I've a problem when I try to load the tests suite. > > First of all, on the Debian package I maintain [1] uses clc, the > Common Lisp Controller [2]. Thus, it installs files in > > /usr/share/common-lisp/source/[package] > > For I don't know which strange reason, I didn't included the test > suite in the previous Debian versions, so I'm doing it for the next > one (which will include also a new CVS checkout). > > I created a second ASDF system which loads the test, instead of > > $ sbcl --load /usr/share/common-lisp/source/s-xml/test/all-tests.lisp > > --8<---------------cut here---------------start------------->8--- > Index: s-xml.asd > =================================================================== > RCS file: /project/s-xml/cvsroot/s-xml/s-xml.asd,v > retrieving revision 1.2 > diff -u -r1.2 s-xml.asd > --- s-xml.asd 14 Dec 2005 21:49:04 -0000 1.2 > +++ s-xml.asd 13 May 2006 18:36:04 -0000 > @@ -31,4 +31,14 @@ > (:file "sxml-dom" :depends-on ("dom")) > (:file "xml-struct-dom" :depends-on ("dom")))))) > > +(defsystem :s-xml.test > + :depends-on (:s-xml) > + :components > + ((:module > + :test > + :components ((:file "test-xml") > + (:file "test-xml-struct-dom") > + (:file "test-lxml-dom") > + (:file "test-sxml-dom"))))) > + > ;;;; eof > --8<---------------cut here---------------end--------------->8--- > > If it won't be included upstream I'll probably get it in the Debian > package anyway, but only after having found the best solution to the > whole problem. > > With the above patch, I got various errors: > ===== > $ sbcl > $ * (asdf:oos 'asdf:load-op 's-xml) > $ * (asdf:oos 'asdf:load-op 's-xml.test) > [...] > > ; /var/cache/common-lisp-controller/1000/sbcl/s-xml/test/test- > sxml-dom.fasl written > ; compilation finished in 0:00:00 > > debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread > #: > error opening #P"/var/cache/common-lisp-controller/1000/sbcl/s- > xml/test/xhtml-page.xml": > No such file or directory > > * (quit) > ===== > > So, the problem is *load-pathname* and I cannot find something like > *source-pathname* :-( > > One possible solution is the following, but it ASDF-specific: > > --8<---------------cut here---------------start------------->8--- > Index: test/test-xml-struct-dom.lisp > =================================================================== > RCS file: /project/s-xml/cvsroot/s-xml/test/test-xml-struct-dom.lisp,v > retrieving revision 1.2 > diff -u -r1.2 test-xml-struct-dom.lisp > --- test/test-xml-struct-dom.lisp 29 Aug 2005 15:01:49 -0000 > 1.2 > +++ test/test-xml-struct-dom.lisp 13 May 2006 18:48:08 -0000 > @@ -44,8 +44,13 @@ > " text, with a leading & > trailing space ")))) > > (assert > - (xml-element-p (parse-xml-file (merge-pathnames "xhtml-page.xml" > *load-pathname*) > - :output-type :xml-struct))) > + (xml-element-p (parse-xml-file > + (merge-pathnames > + "test/xhtml-page.xml" > + (truename > + (asdf:component-pathname > + (asdf:find-system :s-xml.test)))) > + :output-type :xml-struct))) > > (assert > (xml-element-p (parse-xml-file (merge-pathnames "ant-build- > file.xml" *load-pathname*) > --8<---------------cut here---------------end--------------->8--- > > Obviously, this should be done every time we parse an XML-file, so > it's going to be quite a big modification. Moreover, as I said, this > is ASDF-specific, thus I'm asking for help in order to find a more > general solution. > > In case nothing will be found, we can use #+common-lisp-controller or > I can patch s-xml only for Debian (which would be absolutely fine, but > I'll still prefer a general solution). > > Thx, bye, > Gismo / Luca > > [1] http://packages.debian.org/cl-s-xml > [2] http://www.cliki.net/common-lisp-controller > _______________________________________________ > s-xml-devel site list > s-xml-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/s-xml-devel From luca at pca.it Sun May 14 23:03:51 2006 From: luca at pca.it (Luca Capello) Date: Sun, 14 May 2006 18:03:51 -0500 Subject: [s-xml-devel] Problem when loading the tests with the CLC In-Reply-To: (Sven Van Caekenberghe's message of "Sun, 14 May 2006 22:32:53 +0200") References: <873bfdwy1j.fsf@gismo.pca.it> Message-ID: <871wuw2oq0.fsf@gismo.pca.it> Hi Sven! On Sun, 14 May 2006 15:32:53 -0500, Sven Van Caekenberghe wrote: > The test suite was designed to be loaded and not compiled - that > way, *load-pathname* is correct with respect to the needed test > resources files. Indeed, loading the test/all-tests.lisp file works: ===== $ sbcl [...] * (asdf:oos 'asdf:load-op 's-xml) [...] * (load "/usr/share/common-lisp/source/s-xml/test/all-tests.lisp") ;; loading #P"/usr/share/common-lisp/source/s-xml/test/test-xml.lisp" ;; loading #P"/usr/share/common-lisp/source/s-xml/test/test-xml-struct-dom.lisp" ;; loading #P"/usr/share/common-lisp/source/s-xml/test/test-lxml-dom.lisp" ;; loading #P"/usr/share/common-lisp/source/s-xml/test/test-sxml-dom.lisp" T * (quit) ===== > Of course it would be a good idea to make an asdf of the test suite, > and use it properly. I am not sure what the correct solution > is. What do other CL projects do in similar cases ? Isn't there a > way to prevent asdf from compiling certain files - maybe that could > be a solution ? I'm not an ASDF expert, maybe Peter could be more helpful. The other CL projects having a test suite I know (mostly the BESE software at [1]) use ASDF-compiling files and AFAIK from reading the ASDF documentation [2] [3] you could not prevent compilation of certain files (which indeed should be the best solution). I think that in the meantime I'll provide a note in the README.Debian explaining how to load the test/all-tests.lisp file. Thx, bye, Gismo / Luca [1] http://common-lisp.net/projects/bese/ [2] http://constantly.at/lisp/asdf/ [3] http://common-lisp.net/~mmommer/asdf-howto.shtml -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: