(require :asdf) (assert (string= "2.5.4" (lisp-implementation-version))) (setf *compile-verbose* nil *load-verbose* nil) (asdf:load-asd "/Users/rgb/workspace/topic-maps/topic-maps.asd") (asdf:test-system "topic-maps/xtm") (topic-maps.xtm.tests:write-report "/private/tmp/xtm-slice-21c-uvb60rqn/baseline-xtm.json") (in-package :topic-maps.xtm.tests) (defun observation-condition (c) (when c (let* ((xtm (typep c 'topic-maps.xtm:xtm-error)) (code (cond (xtm (error-code c)) ((typep c 'item-identifier-error) (item-identifier-error-code c))))) (topic-maps.test-foundation::fields "class" (string (type-of c)) "code" (when code (string-downcase (string code))) "detail" (cond (xtm (topic-maps.xtm:error-detail c)) ((typep c 'item-identifier-error) (topic-maps.tmdm::item-identifier-error-detail c))) "message" (princ-to-string c) "line" (when xtm (error-line c)) "column" (when xtm (error-column c)) "positionUnit" (when xtm "approximate-SAX-line-column") "documentIRI" (when xtm (error-document-iri c)) "sourceKey" (when xtm (error-source-key c)) "cause" (when (typep c 'xtm-xml-error) (observation-condition (topic-maps.xtm:error-cause c))))))) (let ((rows nil)) (dolist (name '("id-invalid" "itemid-collision" "no-version" "reifier-elem-in-2.0" "subjid-ref-in-2.0" "subjloc-ref-in-2.0" "topic-no-id")) (let* ((id (format nil "xtm2/invalid/~A.xtm" name)) (iri (concatenate 'string "https://xtm-tests.example.invalid/cd165b150176c1d6842b37be9cc9051b40d4996b/" id)) (raw (file-bytes (corpus-path id))) (xml (topic-maps.xml:parse-octets raw (make-instance 'topic-maps.xtm::source-handler))) (c (condition-from (lambda () (deserialize-octets raw :document-iri iri :source-key id))))) (assert xml) (push (topic-maps.test-foundation::fields "id" id "documentIRI" iri "sourceBytes" (length raw) "sourceHex" (format nil "~{~2,'0X~}" (coerce raw 'list)) "sourceText" (babel:octets-to-string raw :encoding :utf-8) "xmlWellFormed" :true "condition" (observation-condition c)) rows))) (with-open-file (out "/private/tmp/xtm-slice-21c-uvb60rqn/observed-before-registration.json" :direction :output :if-exists :supersede) (topic-maps.test-foundation::emit-json-value (coerce (nreverse rows) 'vector) out) (terpri out))) (assert (not (find-package :topic-maps.ctm)))