[s-xml-devel] Problem when loading the tests with the CLC

Luca Capello luca at pca.it
Sat May 13 18:59:52 UTC 2006


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
  #<THREAD "initial thread" {A7F0409}>:
    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: <https://mailman.common-lisp.net/pipermail/s-xml-devel/attachments/20060513/eb9b15c3/attachment.sig>


More information about the s-xml-devel mailing list