summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-06 01:25:03 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-06 01:25:06 +0100
commit3878cc670777514c5deb8691d882520009b47f24 (patch)
tree681fbdcd23bd6644532660b560fd3ea8d4ca66f0
parent67f483238447d465eaaf1d82b9d85fa8d7fc2bec (diff)
downloadrust-mode-3878cc670777514c5deb8691d882520009b47f24.tar.gz
Allow user to override which emacs is used in run_rust_emacs_tests.sh
Namely, extend script so user can do, e.g.: ``` % EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs run_rust_emacs_tests.sh ```
-rwxr-xr-xrun_rust_emacs_tests.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/run_rust_emacs_tests.sh b/run_rust_emacs_tests.sh
index b35fcf8..dc4458f 100755
--- a/run_rust_emacs_tests.sh
+++ b/run_rust_emacs_tests.sh
@@ -10,5 +10,13 @@
# except according to those terms.
#
# This runs the test for emacs rust-mode.
-# It must be possible to find emacs via PATH.
-emacs -batch -l rust-mode.el -l rust-mode-tests.el -f ert-run-tests-batch-and-exit
+# Either $EMACS must be set, or it must be possible to find emacs via PATH.
+
+if [ -z "$EMACS" ]; then
+ EMACS=emacs
+elif [ ! $(which "$EMACS") ]; then
+ echo "You must set EMACS to a program that runs emacs."
+ exit 1
+fi
+
+"$EMACS" -batch -l rust-mode.el -l rust-mode-tests.el -f ert-run-tests-batch-and-exit