From 5c248b8bb63ee2f32e189a6a4f0202539fd991ed Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Fri, 17 Aug 2012 18:56:01 +0100 Subject: Add test_indentation target to lib/tools/emacs/Makefile Automatically indent test.erl.orig, save to test.erl, and compare to test.erl.intended. --- lib/tools/emacs/Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib') 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" -- cgit v1.2.3