aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-08 16:09:44 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-09 18:28:25 -0400
commitc16ada7749d842fa868b7b8b25a1ff17ffdf7b40 (patch)
tree8a4d4460d4572af5590302d5c927e8ed66b689ae /test
parentocda loader: one way in whatever the source (diff)
output: the abstraction artefacts live with the pod
pod/ holds all document source representations: pod/<doc>/ source tree pod/<doc>/media/abstraction/<uid>.ssp abstraction, as text pod/<doc>.zip tree, zipped, .ssp included pod/<doc>.digests.txt sha256s of what is in them pod/<uid>.ocda.db abstraction, as sqlite db <lang>/abstraction/ is gone. pod/<doc>/media/abstraction/<uid>.ssp preferred as having the images (found within the pod tree) which .ssp needs to reproduce a document but does not carry on its own. The .ocda.db sits carries the images as well and (like the pod.zip) can be used to reproduce a document directly. digests.txt now covers the database as well as the zip, the source and the .ssp; (as does the metadata html page). Two ordering issues addressed: - the pod builder clean-slates pod/<doc>/ before regenerating it, and the .ssp is now written before that runs. The clean slate now leaves media/abstraction/ alone, and the .ssp writer clears that directory itself on the first language of a run, so a .ssp for a language the document no longer is removed and cannot be bundled. - for a multi-language document the .ssp files accumulate one language at a time and are bundled on the last, which is why the directory cannot simply be emptied by whichever (language) gets there first. (assisted by Claude-Code)
Diffstat (limited to 'test')
-rw-r--r--[-rwxr-xr-x]test/test-abstraction-db-roundtrip.sh8
-rw-r--r--[-rwxr-xr-x]test/test-abstraction-db.sh6
2 files changed, 9 insertions, 5 deletions
diff --git a/test/test-abstraction-db-roundtrip.sh b/test/test-abstraction-db-roundtrip.sh
index ecde696..b3d5b0d 100755..100644
--- a/test/test-abstraction-db-roundtrip.sh
+++ b/test/test-abstraction-db-roundtrip.sh
@@ -62,10 +62,12 @@ $SPINE_BIN --show-abstraction --show-abstraction-db --skip-output \
COUNT=0
FAILURES=0
-for db in "$OUT_DIR"/*/abstraction/*.ocda.db; do
+# the database sits beside the pod (pod/<uid>.ocda.db), the .ssp inside it
+# (pod/<doc>/media/abstraction/<uid>.ssp)
+for db in "$OUT_DIR"/pod/*.ocda.db; do
[ -f "$db" ] || continue
- ssp="${db%.ocda.db}.ssp"
- base=$(basename "$ssp")
+ base=$(basename "$db" .ocda.db)
+ ssp=$(find "$OUT_DIR/pod" -name "$base.ssp" 2>/dev/null | head -1)
COUNT=$((COUNT + 1))
if [ ! -f "$ssp" ]; then
echo "MISSING .ssp for $base"
diff --git a/test/test-abstraction-db.sh b/test/test-abstraction-db.sh
index a850187..27a6e65 100755..100644
--- a/test/test-abstraction-db.sh
+++ b/test/test-abstraction-db.sh
@@ -121,10 +121,12 @@ lev4_subtoc|object_subtoc
report() { echo " MISMATCH $1: .ssp $2, db $3"; }
-for ssp in "$OUT_DIR"/*/abstraction/*.ssp; do
+# the .ssp is written into the pod tree (pod/<doc>/media/abstraction/), the
+# database beside it (pod/<uid>.ocda.db)
+for ssp in $(find "$OUT_DIR/pod" -name "*.ssp" 2>/dev/null | sort); do
[ -f "$ssp" ] || continue
- db="${ssp%.ssp}.ocda.db"
base=$(basename "$ssp" .ssp)
+ db="$OUT_DIR/pod/$base.ocda.db"
if [ ! -f "$db" ]; then
echo "MISSING db for $base"
FAILURES=$((FAILURES + 1))