#!/bin/sh # Run the RAIL test suite in a batch Emacs. # # Required dependency: emacs, with Org mode. Org mode ships with Emacs. # The suite needs no MCP framework and no configuration. It runs on any # machine. Every test uses a temporary stream file, so the project stream # file stays unchanged. # # Exit status: 0 when every test passes, 1 otherwise. set -eu dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) if ! command -v emacs >/dev/null 2>&1; then echo "Error: emacs is not on PATH. Install Emacs, then run this script again." >&2 exit 1 fi for file in rail-tools.el rail-tests.el; do if [ ! -r "$dir/$file" ]; then echo "Error: cannot read $dir/$file. The skill directory is incomplete." >&2 exit 1 fi done if emacs --batch -Q \ -l "$dir/rail-tools.el" \ -l "$dir/rail-tests.el" \ -f ert-run-tests-batch-and-exit; then echo "RAIL tests passed." else echo "Error: RAIL tests failed. Read the ERT output above for the failing test." >&2 exit 1 fi