aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-08-27 13:33:36 +0200
committerFredrik Gustafsson <[email protected]>2012-08-27 13:33:36 +0200
commit46dea84b7af49d5a4d20fce06b5c10bdccbe19d5 (patch)
tree4c73679a179b8e7e0f95659be3104f1cfabcc9e0 /lib/tools
parentd052e2ada84051ee5c23c7b358a642554055c8d2 (diff)
parent5c248b8bb63ee2f32e189a6a4f0202539fd991ed (diff)
downloadotp-46dea84b7af49d5a4d20fce06b5c10bdccbe19d5.tar.gz
otp-46dea84b7af49d5a4d20fce06b5c10bdccbe19d5.tar.bz2
otp-46dea84b7af49d5a4d20fce06b5c10bdccbe19d5.zip
Merge branch 'mh/emacs-test-indentation/OTP-10226' into maint
* mh/emacs-test-indentation/OTP-10226: Add test_indentation target to lib/tools/emacs/Makefile
Diffstat (limited to 'lib/tools')
-rw-r--r--lib/tools/emacs/Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tools/emacs/Makefile b/lib/tools/emacs/Makefile
index e5ed56b412..69946be24a 100644
--- a/lib/tools/emacs/Makefile
+++ b/lib/tools/emacs/Makefile
@@ -86,3 +86,19 @@ release_docs_spec: docs
$(INSTALL_DATA) $(MAN_FILES) "$(RELEASE_PATH)/man/man3"
endif
endif
+
+EMACS ?= emacs
+
+test_indentation:
+ @rm -f test.erl
+ @rm -f test_indent.el
+ @echo '(load "erlang-start")' >> test_indent.el
+ @echo '(find-file "test.erl.orig")' >> test_indent.el
+ @echo "(require 'cl) ; required with Emacs < 23 for ignore-errors" >> test_indent.el
+ @echo '(erlang-mode)' >> test_indent.el
+ @echo '(toggle-debug-on-error)' >> test_indent.el
+ @echo '(erlang-indent-current-buffer)' >> test_indent.el
+ @echo '(write-file "test.erl")' >> test_indent.el
+ $(EMACS) --batch -Q -L . -l test_indent.el
+ diff -u test.erl.indented test.erl
+ @echo "No differences between expected and actual indentation"