1 ;;; emacstest-suites.el --- Some unit tests for Emacs
3 ;; Author: Lennart Borgman (lennart O borgman A gmail O com)
4 ;; Created: 2008-09-21T22:34:11+0200 Sun
6 ;; Last-Updated: 2008-09-22T00:36:11+0200 Sun
11 ;; Features that might be required by this library:
13 ;; `button', `cl', `debug', `ert', `ert2', `ewoc', `find-func',
14 ;; `help-fns', `help-mode', `view'.
16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20 ;; Unit tests for some Emacs bug reports.
22 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29 ;; This program is free software; you can redistribute it and/or
30 ;; modify it under the terms of the GNU General Public License as
31 ;; published by the Free Software Foundation; either version 2, or
32 ;; (at your option) any later version.
34 ;; This program is distributed in the hope that it will be useful,
35 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
36 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37 ;; General Public License for more details.
39 ;; You should have received a copy of the GNU General Public License
40 ;; along with this program; see the file COPYING. If not, write to
41 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
42 ;; Floor, Boston, MA 02110-1301, USA.
44 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
48 (eval-when-compile (require 'cl))
50 (let* ((this-file (or load-file-name
51 (when (boundp 'bytecomp-filename) bytecomp-filename)
53 (this-dir (file-name-directory this-file))
54 (load-path (cons this-dir load-path)))
57 (setq debug-on-error t)
60 (file-name-directory (if load-file-name load-file-name buffer-file-name)))
62 (pushnew emacstest-bin load-path)
66 (defvar emacstest-files-root
67 (let* ((this-dir emacstest-bin)
68 (root (expand-file-name "inemacs/" this-dir)))
69 (unless (file-accessible-directory-p root)
70 (error (if (file-exists-p root)
71 "Can't read files in test directory %s"
72 "Can't find test directory %s")
76 (let ((distr-in "c:/EmacsW32/nxhtml/tests/inemacs/"))
77 (when (file-directory-p distr-in)
78 (setq emacstest-files-root distr-in)))
80 (defun emacstest-run ()
83 (setq message-log-max t)
84 (setq ert-test-files-root emacstest-files-root)
85 (let ((selector "emacs-"))
87 (ert-run-tests-batch selector)
88 (ert-kill-temp-test-buffers)
89 (ert-run-tests-interactively selector)
91 (ert-list-temp-test-buffers))))
93 (ert-deftest emacs-bug1013 ()
96 `http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1013'."
97 (ert-with-temp-buffer-include-file "bug1013.el"
100 (provide 'emacstest-suites)
101 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
102 ;;; emacstest-suites.el ends here