1 ;; Initialize tests -*- lexical-binding: t -*-
3 (defun init-rst-ert (&optional with-buffer
)
5 Prepare for buffer using tests if WITH-BUFFER."
7 (add-to-list 'load-path
".")
8 (load "ert-buffer" nil t
)
9 (if (equal (car load-path
) ".")
10 (setq load-path
(cdr load-path
))))
12 (add-to-list 'load-path
"..")
14 (if (equal (car load-path
) "..")
15 (setq load-path
(cdr load-path
)))
17 ;; Emacs 24 should have a patch in `testcover-after` declaring a
19 (if (< emacs-major-version
24)
20 ;; Define a setf-method for `testcover-after' so `ert' tests can be run
22 (defsetf testcover-after
(idx val
) (store)
24 (list 'testcover-after idx val
)
25 ;; FIXME: Though it solves the problem it is not really correct
26 ;; because `val' is only a temporary variable here.
27 (list 'setf val store
)))))
29 ;; Clean up `load-path' if set caller just to load this file.
30 (if (equal (car load-path
) ".")
31 (setq load-path
(cdr load-path
)))