aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test-abstraction-db.sh
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-08 12:21:31 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-09 18:10:24 -0400
commit513a1490084e2679670dd6241e1473c3c221f1ff (patch)
tree35b690ed07f8de488a608408690443464fe0f244 /test/test-abstraction-db.sh
parentocda db: built from the .ssp, (tethered) (diff)
ocda db: <doc>.ocda.db, and a script to run 4 tests
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)
Diffstat (limited to 'test/test-abstraction-db.sh')
-rwxr-xr-xtest/test-abstraction-db.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test-abstraction-db.sh b/test/test-abstraction-db.sh
index 5c4162f..a850187 100755
--- a/test/test-abstraction-db.sh
+++ b/test/test-abstraction-db.sh
@@ -2,7 +2,7 @@
# test-abstraction-db.sh
#
# Cross-check for spine's two serialisations of the document abstraction:
-# the .ssp text file and the <doc>.abstraction.db sqlite database.
+# the .ssp text file and the <doc>.ocda.db sqlite database.
#
# It generates both for every sample document and asserts that they agree
# object for object and field for field. There is no committed reference
@@ -63,7 +63,7 @@ OUT_DIR="$SCRIPT_DIR/current-db"
echo "spine binary: $SPINE_BIN"
echo "samples: $SAMPLES_DIR"
-echo "Generating .ssp and .abstraction.db ..."
+echo "Generating .ssp and .ocda.db ..."
rm -rf "$OUT_DIR"
mkdir -p "$OUT_DIR"
$SPINE_BIN --show-abstraction --show-abstraction-db --skip-output \
@@ -123,7 +123,7 @@ report() { echo " MISMATCH $1: .ssp $2, db $3"; }
for ssp in "$OUT_DIR"/*/abstraction/*.ssp; do
[ -f "$ssp" ] || continue
- db="${ssp%.ssp}.abstraction.db"
+ db="${ssp%.ssp}.ocda.db"
base=$(basename "$ssp" .ssp)
if [ ! -f "$db" ]; then
echo "MISSING db for $base"
@@ -222,7 +222,7 @@ done
rm -rf "$OUT_DIR"
if [ "$FAILURES" -eq 0 ]; then
- echo "PASS: .ssp and .abstraction.db agree for all $DOCS documents"
+ echo "PASS: .ssp and .ocda.db agree for all $DOCS documents"
exit 0
else
echo "FAIL: $FAILURES document(s) disagree"