]> dreyeck.freedombox.rocks Git - topic-maps.git/blob - scripts/fresh-sbcl.lisp
feat(ctm): decode ISO-8859-5 with qualified charset aliases
[topic-maps.git] / scripts / fresh-sbcl.lisp
1 (require :asdf)
2 ;; No Quicklisp/user registry, no HyperDoc systems, no persistent Lisp image.
3 (asdf:initialize-source-registry '(:source-registry :ignore-inherited-configuration))
4 (asdf:initialize-output-translations
5 '(:output-translations (t (:root "tmp" "topic-maps-fasls")) :ignore-inherited-configuration))
6 (let* ((root (uiop:pathname-parent-directory-pathname
7 (uiop:pathname-directory-pathname *load-truename*)))
8 (report (uiop:getenv "TOPIC_MAPS_REPORT")))
9 (asdf:load-asd (merge-pathnames "topic-maps.asd" root))
10 (asdf:test-system "topic-maps/tests")
11 (asdf:test-system "topic-maps/ctm/tests")
12 (asdf:test-system "topic-maps/ctm/merging-tests")
13 (asdf:test-system "topic-maps/ctm/association-tests")
14 ;; Import tests run all retained CTM/TMDM/CXTM suites once.
15 (asdf:test-system "topic-maps/ctm/include-tests")
16 (when report
17 (uiop:symbol-call :topic-maps.ctm.tests :write-slice-report
18 report (concatenate 'string report ".semantics.json"))
19 (uiop:symbol-call :topic-maps.ctm.tests :write-merging-report
20 (concatenate 'string report ".merging.json"))
21 (uiop:symbol-call :topic-maps.ctm.tests :write-association-report
22 (concatenate 'string report ".associations.json"))
23 (uiop:symbol-call :topic-maps.ctm.tests :write-cxtm-report
24 report (concatenate 'string report ".cxtm.json")
25 :additional-checks (append (uiop:symbol-call :topic-maps.ctm.tests :occurrence-checks)
26 (uiop:symbol-call :topic-maps.ctm.tests :prefix-checks)
27 (uiop:symbol-call :topic-maps.ctm.tests :integer-checks)
28 (uiop:symbol-call :topic-maps.ctm.tests :decimal-checks)
29 (uiop:symbol-call :topic-maps.ctm.tests :date-checks)
30 (uiop:symbol-call :topic-maps.ctm.tests :datetime-checks)
31 (uiop:symbol-call :topic-maps.ctm.tests :timezone-checks)
32 (uiop:symbol-call :topic-maps.ctm.tests :typed-name-checks)
33 (uiop:symbol-call :topic-maps.ctm.tests :scope-checks)
34 (uiop:symbol-call :topic-maps.variant.tests :variant-checks)
35 (uiop:symbol-call :topic-maps.reference.tests :reference-checks)
36 (uiop:symbol-call :topic-maps.identifier.tests :identifier-checks)
37 (uiop:symbol-call :topic-maps.reification.tests :reification-checks)
38 (uiop:symbol-call :topic-maps.arity.tests :arity-checks)
39 (uiop:symbol-call :topic-maps.relationship.tests :relationship-checks)
40 (uiop:symbol-call :topic-maps.template.tests :template-checks)
41 (uiop:symbol-call :topic-maps.import.tests :import-checks)
42 (uiop:symbol-call :topic-maps.mergemap.tests :mergemap-checks)
43 (uiop:symbol-call :topic-maps.include.tests :include-checks))
44 :scope "Slice 19C: controlled CTM Include and Mergemap; 176 byte-equal positives, 28 specific rejections, 2 retained DateTime and 2 explicit Include baseline FAILs. XTM Mergemap remains NOT-RUN")
45 (uiop:symbol-call :topic-maps.ctm.tests :write-occurrence-report
46 (concatenate 'string report ".occurrences.json"))
47 (uiop:symbol-call :topic-maps.ctm.tests :write-prefix-report
48 (concatenate 'string report ".prefixes.json"))
49 (uiop:symbol-call :topic-maps.ctm.tests :write-integer-report
50 (concatenate 'string report ".integers.json"))
51 (uiop:symbol-call :topic-maps.ctm.tests :write-decimal-report
52 (concatenate 'string report ".decimals.json"))
53 (uiop:symbol-call :topic-maps.ctm.tests :write-date-report
54 (concatenate 'string report ".dates.json"))
55 (uiop:symbol-call :topic-maps.ctm.tests :write-datetime-report
56 (concatenate 'string report ".datetimes.json"))
57 (uiop:symbol-call :topic-maps.ctm.tests :write-timezone-report
58 (concatenate 'string report ".timezones.json"))
59 (uiop:symbol-call :topic-maps.ctm.tests :write-typed-name-report
60 (concatenate 'string report ".typed-names.json"))
61 (uiop:symbol-call :topic-maps.ctm.tests :write-scope-report
62 (concatenate 'string report ".scopes.json"))
63 (uiop:symbol-call :topic-maps.variant.tests :write-variant-report
64 (concatenate 'string report ".variants.json"))
65 (uiop:symbol-call :topic-maps.reference.tests :write-reference-report
66 (concatenate 'string report ".references.json"))
67 (uiop:symbol-call :topic-maps.identifier.tests :write-identifier-report
68 (concatenate 'string report ".identifiers.json"))
69 (uiop:symbol-call :topic-maps.reification.tests :write-reification-report
70 (concatenate 'string report ".reification.json"))
71 (uiop:symbol-call :topic-maps.arity.tests :write-arity-report
72 (concatenate 'string report ".arity.json"))
73 (uiop:symbol-call :topic-maps.relationship.tests :write-relationship-report
74 (concatenate 'string report ".relationships.json"))
75 (uiop:symbol-call :topic-maps.template.tests :write-template-report
76 (concatenate 'string report ".templates.json"))
77 (uiop:symbol-call :topic-maps.import.tests :write-import-report
78 (concatenate 'string report ".map-import.json"))
79 (uiop:symbol-call :topic-maps.mergemap.tests :write-mergemap-report
80 (concatenate 'string report ".mergemap.json"))
81 (uiop:symbol-call :topic-maps.include.tests :write-include-report
82 (concatenate 'string report ".include.json"))))
83
84 ;; Explicit opt-in integration after the unchanged core suites and reports.
85 ;; Restore only the caller's qualified source registry, then load the adapter.
86 (let ((prefix (uiop:getenv "TOPIC_MAPS_XTM_MERGEMAP_REPORT")))
87 (when prefix
88 (let ((calls 0))
89 (handler-case
90 (progn
91 (uiop:symbol-call :topic-maps.ctm :deserialize-string
92 "%mergemap <urn:unfetched> <http://psi.topicmaps.org/iso13250/xtm>"
93 :document-iri "urn:adapter-boundary"
94 :resource-resolver (lambda (&rest args) (declare (ignore args)) (incf calls)))
95 (error "Core CTM unexpectedly accepted XTM without its explicit adapter."))
96 (topic-maps.ctm:ctm-unsupported (condition)
97 (assert (and (zerop calls) (eq :xtm-mergemap-reader-required (topic-maps.ctm:error-code condition)))))))
98 (format t "XTM-ADAPTER-BOUNDARY-PASS: explicit adapter required before resource retrieval~%")
99 (asdf:initialize-source-registry
100 (let ((*read-eval* nil))
101 (read-from-string
102 (or (uiop:getenv "CL_SOURCE_REGISTRY")
103 (error "XTM integration requires the prepared qualified source registry.")))))
104 (asdf:test-system "topic-maps/ctm/xtm-tests")
105 (uiop:symbol-call :topic-maps.xtm-mergemap.tests :write-reports prefix)))
106
107
108 ;; Slice 20A registration always runs after the retained suites and the optional
109 ;; XTM adapter. Historical reports above remain snapshots of their own stages.
110 (asdf:test-system "topic-maps/ctm/registered-original-tests")
111 (let ((prefix (uiop:getenv "TOPIC_MAPS_REGISTERED_ORIGINALS_REPORT")))
112 (when prefix
113 (uiop:symbol-call :topic-maps.registered-original.tests :write-reports prefix)))
114
115
116 ;; Slice 20B runs after the unchanged Slice 20A snapshot in the same fresh process.
117 (asdf:test-system "topic-maps/ctm/registered-negative-tests")
118 (let ((prefix (uiop:getenv "TOPIC_MAPS_REGISTERED_NEGATIVES_REPORT")))
119 (when prefix
120 (uiop:symbol-call :topic-maps.registered-original.tests :write-negative-reports prefix)))
121
122 ;; Slice 20C: retained 20A/20B snapshots precede the new original contracts.
123 (asdf:test-system "topic-maps/ctm/prolog-tests")
124 (let ((prefix (uiop:getenv "TOPIC_MAPS_PROLOG_REPORT")))
125 (when prefix (uiop:symbol-call :topic-maps.prolog.tests :write-reports prefix)))
126
127
128 ;; Slice 20E: one positive original after all retained stage snapshots.
129 (asdf:test-system "topic-maps/ctm/empty2-tests")
130 (let ((prefix (uiop:getenv "TOPIC_MAPS_EMPTY2_REPORT")))
131 (when prefix
132 (uiop:symbol-call :topic-maps.registered-original.tests :write-empty2-reports prefix)))
133
134
135 ;; Slice 20F: original CTM-integer literal after all retained stage reports.
136 (asdf:test-system "topic-maps/ctm/ctm-integer-tests")
137 (let ((prefix (uiop:getenv "TOPIC_MAPS_CTM_INTEGER_REPORT")))
138 (when prefix (uiop:symbol-call :topic-maps.ctm-integer.tests :write-reports prefix)))
139
140
141 ;; Slice 20G: four original Triple Strings after retained stage reports.
142 (asdf:test-system "topic-maps/ctm/triple-string-tests")
143 (let ((prefix (uiop:getenv "TOPIC_MAPS_TRIPLE_REPORT")))
144 (when prefix (uiop:symbol-call :topic-maps.triple.tests :write-reports prefix)))
145
146
147 ;; Slice 20H: qualified ISO-8859-5 after all retained stage snapshots.
148 (asdf:test-system "topic-maps/ctm/encoding-tests")
149 (let ((prefix (uiop:getenv "TOPIC_MAPS_ENCODING_REPORT")))
150 (when prefix (uiop:symbol-call :topic-maps.encoding.tests :write-reports prefix)))