branch: elpa/forth-mode
commit 82f746ba54075b600fb5fca0c60c0f7e211b32e4
Author: Lars Brinkhoff <[email protected]>
Commit: Lars Brinkhoff <[email protected]>
Use ERT for some light testing as part of build.
---
Makefile | 5 ++++-
build.el | 10 +++++++++-
forth-mode.el | 4 ++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 359876c184..15cfc1b1ac 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
+EMACS ?= emacs
+EMACS_LOAD = $(EMACS) -Q --batch --load
+
all:
- emacs -Q --batch --load build.el
+ $(EMACS_LOAD) build.el
clean:
rm -f autoloads.el *.elc
diff --git a/build.el b/build.el
index ca2fded45e..f0c599d040 100644
--- a/build.el
+++ b/build.el
@@ -5,7 +5,15 @@
(load-file "autoloads.el")
(add-to-list 'load-path ".")
-(require 'ert)
+(if (locate-library "ert")
+ (require 'ert)
+ (defmacro ert-deftest (name args &rest body)
+ `(progn ,@body))
+ (defun ert-run-tests-batch-and-exit ()
+ (kill-emacs 0))
+ (defun should (arg))
+ (defun should-not (arg)))
+
(ert-deftest compile-package ()
"Compile package."
(should-not (string-match "failed" (byte-recompile-directory "." 0))))
diff --git a/forth-mode.el b/forth-mode.el
index 80042797d3..19467fb58c 100644
--- a/forth-mode.el
+++ b/forth-mode.el
@@ -87,6 +87,10 @@
(unless (fboundp 'prog-mode)
(defalias 'prog-mode 'fundamental-mode))
+(unless (fboundp 'setq-local)
+ (defmacro setq-local (var val)
+ `(set (make-local-variable ',var) ,val)))
+
;;;###autoload
(define-derived-mode forth-mode prog-mode "Forth"
"Major mode for editing Forth files."