annotate tests/automated/test-harness.el @ 669:5c696033aec4

[xemacs-hg @ 2001-09-28 15:31:01 by adrian] [PATCH APPROVE] xemacs-21.5: Use xcopy /r in xemacs.mak for NT 4.0 compatibility <uk7yjzo5w.fsf@rapier.ecf.teradyne.com>
author adrian
date Fri, 28 Sep 2001 15:31:01 +0000
parents 1ccc32a20af4
children 6728e641994e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;; test-harness.el --- Run Emacs Lisp test suites.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;;; Copyright (C) 1998 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 ;; Author: Martin Buchholz
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 ;; Keywords: testing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 ;; along with XEmacs; see the file COPYING. If not, write to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; Boston, MA 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;;; Synched up with: Not in FSF.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ;;; A test suite harness for testing XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 ;;; The actual tests are in other files in this directory.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 ;;; Basically you just create files of emacs-lisp, and use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 ;;; Assert, Check-Error, and Check-Message functions to create tests.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 ;;; You run the tests using M-x test-emacs-test-file,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 ;;; or $(EMACS) -batch -l .../test-harness.el -f batch-test-emacs file ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 ;;; which is run for you by the `make check' target in the top-level Makefile.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 (require 'bytecomp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 (defvar test-harness-verbose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 (and (not noninteractive) (> (device-baud-rate) search-slow-speed))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 "*Non-nil means print messages describing progress of emacs-tester.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 (defvar test-harness-current-file nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 (defvar emacs-lisp-file-regexp (purecopy "\\.el\\'")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 "*Regexp which matches Emacs Lisp source files.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 ;;;###autoload
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 (defun test-emacs-test-file (filename)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 "Test a file of Lisp code named FILENAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 The output file's name is made by appending `c' to the end of FILENAME."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 (interactive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 (let ((file buffer-file-name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 (file-name nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 (file-dir nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 (and file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 (eq (cdr (assq 'major-mode (buffer-local-variables)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 'emacs-lisp-mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 (setq file-name (file-name-nondirectory file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 file-dir (file-name-directory file)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 (list (read-file-name "Test file: " file-dir nil nil file-name))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 ;; Expand now so we get the current buffer's defaults
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 (setq filename (expand-file-name filename))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 ;; If we're testing a file that's in a buffer and is modified, offer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 ;; to save it first.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 (or noninteractive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 (let ((b (get-file-buffer (expand-file-name filename))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 (if (and b (buffer-modified-p b)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 (y-or-n-p (format "save buffer %s first? " (buffer-name b))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 (save-excursion (set-buffer b) (save-buffer)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 (if (or noninteractive test-harness-verbose)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 (message "Testing %s..." filename))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 (let ((test-harness-current-file filename)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 input-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 (setq input-buffer (get-buffer-create " *Test Input*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 (set-buffer input-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 (insert-file-contents filename)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 ;; Run hooks including the uncompression hook.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 ;; If they change the file name, then change it for the output also.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 (let ((buffer-file-name filename)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 (default-major-mode 'emacs-lisp-mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 (enable-local-eval nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 (normal-mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 (setq filename buffer-file-name)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 (test-harness-from-buffer input-buffer filename)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 (kill-buffer input-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 (defun test-harness-read-from-buffer (buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 "Read forms from BUFFER, and turn it into a lambda test form."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 (let ((body nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 (goto-char (point-min) buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 (condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 (while t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 (setq body (cons (read buffer) body)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 (end-of-file nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 (princ "Unexpected error %S reading forms from buffer\n" error-info)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 `(lambda ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 (defvar passes)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 (defvar assertion-failures)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 (defvar no-error-failures)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 (defvar wrong-error-failures)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 (defvar missing-message-failures)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 (defvar other-failures)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 (defvar unexpected-test-suite-failure)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 (defvar trick-optimizer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 ,@(nreverse body))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 (defun test-harness-from-buffer (inbuffer filename)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 "Run tests in buffer INBUFFER, visiting FILENAME."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 (defvar trick-optimizer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 (let ((passes 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 (assertion-failures 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 (no-error-failures 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 (wrong-error-failures 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 (missing-message-failures 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 (other-failures 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 (trick-optimizer nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 (unexpected-test-suite-failure nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 (debug-on-error t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 (with-output-to-temp-buffer "*Test-Log*"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 (defmacro Assert (assertion)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 `(condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 (assert ,assertion)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 (princ (format "PASS: %S" (quote ,assertion)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 (terpri)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 (incf passes))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 (cl-assertion-failed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 (princ (format "FAIL: Assertion failed: %S\n" (quote ,assertion)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 (incf assertion-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 (t (princ (format "FAIL: %S ==> error: %S\n" (quote ,assertion) error-info))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 (incf other-failures)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 (defmacro Check-Error (expected-error &rest body)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 (let ((quoted-body (if (= 1 (length body))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 `(quote ,(car body)) `(quote (progn ,@body)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 `(condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 (setq trick-optimizer (progn ,@body))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 (princ (format "FAIL: %S executed successfully, but expected error %S\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 ,quoted-body
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 ',expected-error))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 (incf no-error-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 (,expected-error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 (princ (format "PASS: %S ==> error %S, as expected\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 ,quoted-body ',expected-error))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 (incf passes))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 (princ (format "FAIL: %S ==> expected error %S, got error %S instead\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 ,quoted-body ',expected-error error-info))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 (incf wrong-error-failures)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 (defmacro Check-Error-Message (expected-error expected-error-regexp &rest body)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 (let ((quoted-body (if (= 1 (length body))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 `(quote ,(car body)) `(quote (progn ,@body)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 `(condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 (setq trick-optimizer (progn ,@body))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 (princ (format "FAIL: %S executed successfully, but expected error %S\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 ,quoted-body
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 ',expected-error))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 (incf no-error-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 (,expected-error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 (let ((error-message (second error-info)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 (if (string-match ,expected-error-regexp error-message)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 (princ (format "PASS: %S ==> error %S %S, as expected\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 ,quoted-body error-message ',expected-error))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 (incf passes))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 (princ (format "FAIL: %S ==> got error %S as expected, but error message %S did not match regexp %S\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 ,quoted-body ',expected-error error-message ,expected-error-regexp))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 (incf wrong-error-failures))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 (princ (format "FAIL: %S ==> expected error %S, got error %S instead\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 ,quoted-body ',expected-error error-info))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 (incf wrong-error-failures)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 (defmacro Check-Message (expected-message-regexp &rest body)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 (let ((quoted-body (if (= 1 (length body))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 `(quote ,(car body)) `(quote (progn ,@body)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 `(let ((messages ""))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 (defadvice message (around collect activate)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 (defvar messages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 (let ((msg-string (apply 'format (ad-get-args 0))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 (setq messages (concat messages msg-string))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 msg-string))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 (condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 (setq trick-optimizer (progn ,@body))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 (if (string-match ,expected-message-regexp messages)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 (princ (format "PASS: %S ==> value %S, message %S, matching %S, as expected\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 ,quoted-body trick-optimizer messages ',expected-message-regexp))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 (incf passes))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 (princ (format "FAIL: %S ==> value %S, message %S, NOT matching expected %S\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 ,quoted-body trick-optimizer messages ',expected-message-regexp))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 (incf missing-message-failures)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 (princ (format "FAIL: %S ==> unexpected error %S\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 ,quoted-body error-info))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 (incf other-failures)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 (ad-unadvise 'message))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 (defmacro Ignore-Ebola (&rest body)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 `(let ((debug-issue-ebola-notices -42)) ,@body))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 (defun Int-to-Marker (pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 (set-buffer standard-output)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 (goto-char pos)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 (point-marker))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 (princ "Testing Interpreted Lisp\n\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 (condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 (funcall (test-harness-read-from-buffer inbuffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 (setq unexpected-test-suite-failure t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 (princ (format "Unexpected error %S while executing interpreted code\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 error-info))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 (message "Unexpected error %S while executing interpreted code." error-info)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 (message "Test suite execution aborted." error-info)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 (princ "\nTesting Compiled Lisp\n\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 (let (code)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 (condition-case error-info
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 428
diff changeset
239 (setq code
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 428
diff changeset
240 ;; our lisp code is often intentionally dubious,
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 428
diff changeset
241 ;; so throw away _all_ the byte compiler warnings.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 428
diff changeset
242 (letf (((symbol-function 'byte-compile-warn) 'ignore))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 428
diff changeset
243 (byte-compile (test-harness-read-from-buffer inbuffer))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 (princ (format "Unexpected error %S while byte-compiling code\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 error-info))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 (condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 (if code (funcall code))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 (princ (format "Unexpected error %S while executing byte-compiled code\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 error-info))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 (message "Unexpected error %S while executing byte-compiled code." error-info)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 (message "Test suite execution aborted." error-info)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 (princ "\nSUMMARY:\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 (princ (format "\t%5d passes\n" passes))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 (princ (format "\t%5d assertion failures\n" assertion-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 (princ (format "\t%5d errors that should have been generated, but weren't\n" no-error-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 (princ (format "\t%5d wrong-error failures\n" wrong-error-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 (princ (format "\t%5d missing-message failures\n" missing-message-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 (princ (format "\t%5d other failures\n" other-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 (let* ((total (+ passes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 assertion-failures
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 no-error-failures
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 wrong-error-failures
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 missing-message-failures
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 other-failures))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 (basename (file-name-nondirectory filename))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 (summary-msg
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 (if (> total 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 (format "%s: %d of %d (%d%%) tests successful."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 basename passes total (/ (* 100 passes) total))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 (format "%s: No tests run" basename))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 (message "%s" summary-msg))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 (when unexpected-test-suite-failure
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 (message "Test suite execution failed unexpectedly."))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 (fmakunbound 'Assert)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 (fmakunbound 'Check-Error)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 (fmakunbound 'Ignore-Ebola)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 (fmakunbound 'Int-to-Marker)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 )))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 (defvar test-harness-results-point-max nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 (defmacro displaying-emacs-test-results (&rest body)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 `(let ((test-harness-results-point-max test-harness-results-point-max))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 ;; Log the file name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 (test-harness-log-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 ;; Record how much is logged now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 ;; We will display the log buffer if anything more is logged
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 ;; before the end of BODY.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 (or test-harness-results-point-max
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 (set-buffer (get-buffer-create "*Test-Log*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 (setq test-harness-results-point-max (point-max))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 (unwind-protect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 (condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 (progn ,@body)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 (test-harness-report-error error-info)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 ;; If there were compilation warnings, display them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 (set-buffer "*Test-Log*")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 (if (= test-harness-results-point-max (point-max))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 (if temp-buffer-show-function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 (let ((show-buffer (get-buffer-create "*Test-Log-Show*")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 (set-buffer show-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 (setq buffer-read-only nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 (erase-buffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 (copy-to-buffer show-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 (save-excursion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 (goto-char test-harness-results-point-max)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 (forward-line -1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 (point))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 (point-max))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 (funcall temp-buffer-show-function show-buffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 (select-window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 (prog1 (selected-window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 (select-window (display-buffer (current-buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 (goto-char test-harness-results-point-max)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 (recenter 1)))))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 (defun batch-test-emacs-1 (file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 (condition-case error-info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 (progn (test-emacs-test-file file) t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 (error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 (princ ">>Error occurred processing ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 (princ file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 (princ ": ")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 (display-error error-info nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 (terpri)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 nil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 (defun batch-test-emacs ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 "Run `test-harness' on the files remaining on the command line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 Use this from the command line, with `-batch';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 it won't work in an interactive Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 Each file is processed even if an error occurred previously.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 For example, invoke \"xemacs -batch -f batch-test-emacs tests/*.el\""
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 ;; command-line-args-left is what is left of the command line (from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 ;; startup.el)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 (defvar command-line-args-left) ;Avoid 'free variable' warning
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 (defvar debug-issue-ebola-notices)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 (if (not noninteractive)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 (error "`batch-test-emacs' is to be used only with -batch"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 (let ((error nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 (dolist (file command-line-args-left)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 (if (file-directory-p file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 (dolist (file-in-dir (directory-files file t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 (when (and (string-match emacs-lisp-file-regexp file-in-dir)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 (not (or (auto-save-file-name-p file-in-dir)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 (backup-file-name-p file-in-dir)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 (equal (file-name-nondirectory file-in-dir)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 "test-harness.el"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 (or (batch-test-emacs-1 file-in-dir)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 (setq error t))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 (or (batch-test-emacs-1 file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 (setq error t))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 ;;(message "%s" (buffer-string nil nil "*Test-Log*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 (message "Done")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 (kill-emacs (if error 1 0))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 (provide 'test-harness)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 ;;; test-harness.el ends here