From b6b5a9b7cf95030c767ec618e0cd2df73783a21b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 9 Jun 2026 07:53:12 -0500 Subject: build(theme-studio): add a local Makefile; root delegates test + coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit theme-studio is a self-contained Python + JS subproject with its own toolchain (python3, node, uvx, headless Chrome), unrelated to the root Makefile's Elisp/ERT world. Gave it a local Makefile that owns that toolchain — test, check (fast, no browser), coverage, gen, open — so the build logic lives with the code and the short target names don't collide with the root's Elisp-flavored test/coverage. The root keeps the discoverable entry points: theme-studio-test and a new theme-studio-coverage now delegate via make -C. run-tests.sh grows a --no-browser flag so `make check` can skip the headless-Chrome gates for a fast inner loop. gen/open take an optional SEED to view a specific palette. coverage reports both halves: node --experimental-test-coverage for the three JS modules (all 100% line, ~96% branch) and uvx coverage for generate.py (89% lines; the rest is the __main__ writer and the optional seed-env branch). --- scripts/theme-studio/run-tests.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts/theme-studio/run-tests.sh') diff --git a/scripts/theme-studio/run-tests.sh b/scripts/theme-studio/run-tests.sh index d57f0044..42d24960 100755 --- a/scripts/theme-studio/run-tests.sh +++ b/scripts/theme-studio/run-tests.sh @@ -16,6 +16,10 @@ set -uo pipefail HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$HERE" +# --no-browser skips the headless-Chrome hash gates for a fast inner loop. +NO_BROWSER=0 +[ "${1:-}" = "--no-browser" ] && NO_BROWSER=1 + fail=0 pass_msg() { printf ' PASS %s\n' "$1"; } fail_msg() { printf ' FAIL %s\n' "$1"; fail=1; } @@ -50,7 +54,9 @@ for c in google-chrome-stable google-chrome chromium chromium-browser; do if command -v "$c" >/dev/null 2>&1; then CHROME="$c"; break; fi done HASHES="selftest cursortest readouttest deltatest oklchtest planetest locktest sorttest" -if [ -z "$CHROME" ]; then +if [ "$NO_BROWSER" = 1 ]; then + skip_msg "browser hash gates (--no-browser)" +elif [ -z "$CHROME" ]; then for t in $HASHES; do skip_msg "#$t (no Chromium-family browser found)"; done else PROF="$(mktemp -d)" -- cgit v1.2.3