aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/run-tests.sh
Commit message (Collapse)AuthorAgeFilesLines
* ocda: warn if heading claims reserved segment nameRalph Amissah2026-09-231-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spine automatically builds some segments, including: (toc, endnotes, glossary, bibliography, bookindex, blurb, _the_title) these are now identified as reserved names and a user is now warned if any of these names have been manually assigned to a heading by markup. A document still builds but to disambiguate the ocn of the heading is attached to the markup (reserved) name and this is seeded before a document not after. It is read off the finished abstraction rather than reported by the parser, and beside the ocn alignment check for the same reason: it is a statement about a document rather than a step in building one. WARNING reserved segment name: the_autonomous_contract... [en] heading 1 at ocn 135 asks for "endnotes", which spine gives its own generated section it is named "endnotes-135" instead; ... A warning: the document is correct and complete and the name it ends up with works. --strict makes it a failure for the run, as it does for ocn alignment, and by the same reasoning: the outputs are written and can be looked at, and the exit status is taken at the end. Two of the thirty-six sample documents have reserved segment names, "1~endnotes" heading. Output is unchanged: nothing here touches the abstraction. (assisted by Claude-Code)
* check required tools; skipped test is incompleteRalph Amissah2026-09-221-23/+55
| | | | | | | | | - check that tools required for a test are present (check for sqlite3, epubcheck; add tools as needed) - report a a skipped test as incomplete (assisted by Claude-Code)
* test: database to pod to artefactsRalph Amissah2026-09-221-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The acceptance test for the document source claim. Two runs of the same spine with the same flags over the same document: - the pod to artefacts and outputs, including database, and - that run's database back to a pod and on to artefacts and outputs. diff -r between the two trees must be empty. One comparison covers the written pod tree with its markup, conf, images and catalogues, the .ssp files, the database itself, the digests, and the text, html and epub built from them. 690 files for live-manual, ten languages and a catalogue tree and no images, and 58 for the wealth of networks, ten images and one language: the two cover each other's gaps, and SpineAcceptanceDocs widens the set. --ocda-verify is asserted separately, before the build. The build would check the same thing and stop, but asking on its own means a failure says which claim broke: that the pod comes back, or that the abstraction it makes is the one recorded with it. The pod for the first run is copied out of the sample set rather than read where it lies. Read in place it has a site configuration above it and a materialised pod has none, and the site url reaches the generated index pages: five files differing in a url, and nothing else, which would read as corruption. Both runs ask for the same flags, the dom structure tags the .ssp records being computed only when an action needs them. The archive is not compared. Neither run writes one: it is a container around bytes compared here already, and its own bytes are not part of what a database claims to carry. (assisted by Claude-Code)
* test: ocn alignment checkRalph Amissah2026-09-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | Asserts the two known divergences in live-manual's translations by name and value: ja two objects short of en, and pl's ocn 313 a paragraph in English and a heading in Polish. It asserts that nothing else is reported: exactly one document warned about, exactly two languages of it. Also the exit codes: 0 without --strict, non-zero with it on the diverging document, and 0 with it on a single language document. It will fail when those two translations are mended, which is the right moment to hear about it, and the message names the expectation that went stale. test-abstraction-db.sh excludes translation.ocn_aligned from its header block comparison, with the other two keys that are the database's notes about the artefact rather than properties of the document. (assisted by Claude-Code)
* test db: multilingual database testRalph Amissah2026-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | one file holding several languages. Both assumed <uid>.<lang>.ocda.db beside <uid>.<lang>.ssp, one for one. - test-abstraction-db.sh takes the language from the .ssp name, the database from the stem, and scopes every query by the doc_id that language resolves to: objects by doc_id, the four child tables through their objects, metadata by doc_id, schema.version by doc_id is null. It also checks what a per language loop cannot see, that the languages a database holds are exactly the languages there are .ssp files for. - test-abstraction-db-roundtrip.sh asks for each language by name and holds it against its own .ssp, and requires a database of more than one language to refuse a round trip that names none: a reader quietly emitting the first language would otherwise pass against the first .ssp and say nothing about the other nine. Its language list comes from the .ssp filenames, so it still needs no sqlite3. databases (re-)emitting all .ssp files exactly. (assisted by Claude-Code)
* test: epubcheck (epub-validity) over sample setRalph Amissah2026-09-141-3/+5
| | | | (assisted by Claude-Code)
* --ocda-db replaces --show-abstraction-dbRalph Amissah2026-09-091-1/+8
| | | | | | | | | ocda (object centric document abstraction) flag --ocda-db (or --abstraction-db) replaces --show-abstraction-db rename results in consequently large diff
* ocda db: <doc>.ocda.db, and a script to run 4 testsRalph Amissah2026-09-091-0/+90
The per document database is now written as <doc_uid>.ocda.db rather than <doc_uid>.abstraction.db. Shorter, and it says what is in the file: the object centric document abstraction, not "some abstraction". .ocda.db pairs with .ssp and cannot be mistaken for the collection search database (spine.search.db). test/run-tests.sh runs the four in sequence, one line of result each, and a summary. It re-runs itself inside nix shell "nixpkgs#sqlite" if sqlite3 is not on PATH, so this is all that is needed: SpinePOD=../../markup/sisudoc-spine-samples/markup/pod-samples/pod \ ./test/run-tests.sh ./bin/spine-ldc The tests are independent (with test-abstraction-ssp.sh run first): 1 test-abstraction-ssp.sh is first because it is the one that says whether the abstraction itself moved; if it fails the others are answering a different question than you think 2 test-abstraction-ssp-roundtrip.sh reads the committed reference set, so it is a statement about the current binary only if 1 passes 3 test-abstraction-db.sh and 4 test-abstraction-db-roundtrip.sh generate both artefacts themselves and depend on nothing committed (assisted by Claude-Code)