Running run-tests.sh in an emacs shell buffer fails with an odd message. I believe the problem is caused by the EMACS environment variable being set to 't' in emacs shells. The following patch seems to fix things.
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-if [ -z ${EMACS} ]; then
+if [ -z ${EMACS} -o ! -x ${EMACS} ]; then
if [ -x "/Applications/Emacs.app/Contents/MacOS/Emacs" ]; then``
EMACS="/Applications/Emacs.app/Contents/MacOS/Emacs"
else