View raw

1 #!/bin/sh 2 # Run the RAIL test suite in a batch Emacs. 3 # 4 # Required dependency: emacs, with Org mode. Org mode ships with Emacs. 5 # The suite needs no MCP framework and no configuration. It runs on any 6 # machine. Every test uses a temporary stream file, so the project stream 7 # file stays unchanged. 8 # 9 # Exit status: 0 when every test passes, 1 otherwise. 10 11 set -eu 12 13 dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) 14 15 if ! command -v emacs >/dev/null 2>&1; then 16 echo "Error: emacs is not on PATH. Install Emacs, then run this script again." >&2 17 exit 1 18 fi 19 20 for file in rail-tools.el rail-tests.el; do 21 if [ ! -r "$dir/$file" ]; then 22 echo "Error: cannot read $dir/$file. The skill directory is incomplete." >&2 23 exit 1 24 fi 25 done 26 27 if emacs --batch -Q \ 28 -l "$dir/rail-tools.el" \ 29 -l "$dir/rail-tests.el" \ 30 -f ert-run-tests-batch-and-exit; then 31 echo "RAIL tests passed." 32 else 33 echo "Error: RAIL tests failed. Read the ERT output above for the failing test." >&2 34 exit 1 35 fi 36