aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/run-tests.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-18 21:24:25 -0500
committerCraig Jennings <c@cjennings.net>2026-06-18 21:24:25 -0500
commitfe196a307877ea69fe4922e49bafa684939d6173 (patch)
treec10d12dc7e8bfdd93afc55cab5dd6345277c8abd /scripts/theme-studio/run-tests.sh
parenta8aa91a257796695d0fbbf471e90bd4ea74c70a8 (diff)
downloaddotemacs-fe196a307877ea69fe4922e49bafa684939d6173.tar.gz
dotemacs-fe196a307877ea69fe4922e49bafa684939d6173.zip
feat(theme-studio): emit the full face-attribute model from build-theme
I extended build-theme's emitter to the full attribute set: family, distant-foreground, a weight and slant range, structured underline (color and wave), overline, strike color, inverse-video, extend, and inherit/height on every tier. It still reads the legacy boolean bold/italic/underline/strike fields, so every committed preset round-trips unchanged. The emitter is the first piece of widening the studio to all face attributes; the model and UI that produce these fields come next. To keep the change clean I refactored --attrs from nine positional arguments to a single face-spec object and lifted the accessor helpers above their callers. Added 40 ERT tests covering legacy compatibility, each new attribute, the coercion helpers' edge cases, and an end-to-end round-trip that loads a theme and reads the attributes back off the faces. They run in the theme-studio suite as a new stage.
Diffstat (limited to 'scripts/theme-studio/run-tests.sh')
-rwxr-xr-xscripts/theme-studio/run-tests.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/theme-studio/run-tests.sh b/scripts/theme-studio/run-tests.sh
index 6666fb0b9..ab9c351ad 100755
--- a/scripts/theme-studio/run-tests.sh
+++ b/scripts/theme-studio/run-tests.sh
@@ -41,6 +41,20 @@ if node --test ./*.mjs >/tmp/ts-node.log 2>&1; then
pass_msg "Node unit tests ($(grep -E '^. tests' /tmp/ts-node.log | grep -oE '[0-9]+' | head -1) tests)"
else fail_msg "Node unit tests"; grep -E 'not ok|AssertionError|Error' /tmp/ts-node.log | sed 's/^/ /' | head -20; fi
+# 3b. ERT tests for build-theme.el (the theme.json -> deftheme emitter). The
+# tests live in the repo's tests/ dir; run them headless. Skip cleanly if no
+# emacs is on PATH (the JS/Python gates still run).
+BT_TESTS="$HERE/../../tests/test-build-theme.el"
+if command -v emacs >/dev/null 2>&1 && [ -f "$BT_TESTS" ]; then
+ if emacs --batch --no-site-file --no-site-lisp \
+ -L "$HERE/../.." -L "$HERE/../../modules" -L "$HERE/../../tests" -L "$HERE/../../themes" \
+ -l "$BT_TESTS" -f ert-run-tests-batch-and-exit >/tmp/ts-bt.log 2>&1; then
+ pass_msg "build-theme.el ERT tests ($(grep -oE 'Ran [0-9]+' /tmp/ts-bt.log | awk '{print $2}') tests)"
+ else fail_msg "build-theme.el ERT tests"; grep -E 'FAILED|Error' /tmp/ts-bt.log | sed 's/^/ /' | head -20; fi
+else
+ skip_msg "build-theme.el ERT tests (no emacs on PATH)"
+fi
+
# 4. Syntax-check the inlined page script.
python3 - <<'PY' && node --check /tmp/ts-script.js >/dev/null 2>&1 && pass_msg "spliced page <script> parses" || fail_msg "spliced page <script> syntax"
import re