428
|
1 ;; test-harness.el --- Run Emacs Lisp test suites.
|
|
2
|
1751
|
3 ;;; Copyright (C) 1998, 2002, 2003 Free Software Foundation, Inc.
|
826
|
4 ;;; Copyright (C) 2002 Ben Wing.
|
428
|
5
|
|
6 ;; Author: Martin Buchholz
|
|
7 ;; Keywords: testing
|
|
8
|
|
9 ;; This file is part of XEmacs.
|
|
10
|
|
11 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
12 ;; under the terms of the GNU General Public License as published by
|
|
13 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
14 ;; any later version.
|
|
15
|
|
16 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19 ;; General Public License for more details.
|
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
|
22 ;; along with XEmacs; see the file COPYING. If not, write to the
|
|
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
24 ;; Boston, MA 02111-1307, USA.
|
|
25
|
|
26 ;;; Synched up with: Not in FSF.
|
|
27
|
|
28 ;;; Commentary:
|
|
29
|
|
30 ;;; A test suite harness for testing XEmacs.
|
|
31 ;;; The actual tests are in other files in this directory.
|
|
32 ;;; Basically you just create files of emacs-lisp, and use the
|
1095
|
33 ;;; Assert, Check-Error, Check-Message, and Check-Error-Message functions
|
|
34 ;;; to create tests. See `test-harness-from-buffer' below.
|
|
35 ;;; Don't suppress tests just because they're due to known bugs not yet
|
1413
|
36 ;;; fixed -- use the Known-Bug-Expect-Failure and
|
|
37 ;;; Implementation-Incomplete-Expect-Failure wrapper macros to mark them.
|
1095
|
38 ;;; A lot of the tests we run push limits; suppress Ebola message with the
|
|
39 ;;; Ignore-Ebola wrapper macro.
|
|
40 ;;;
|
428
|
41 ;;; You run the tests using M-x test-emacs-test-file,
|
|
42 ;;; or $(EMACS) -batch -l .../test-harness.el -f batch-test-emacs file ...
|
|
43 ;;; which is run for you by the `make check' target in the top-level Makefile.
|
|
44
|
|
45 (require 'bytecomp)
|
|
46
|
1758
|
47 (defvar test-harness-test-compiled nil
|
|
48 "Non-nil means the test code was compiled before execution.")
|
|
49
|
428
|
50 (defvar test-harness-verbose
|
|
51 (and (not noninteractive) (> (device-baud-rate) search-slow-speed))
|
|
52 "*Non-nil means print messages describing progress of emacs-tester.")
|
|
53
|
1719
|
54 (defvar test-harness-file-results-alist nil
|
|
55 "Each element is a list (FILE SUCCESSES TESTS).
|
|
56 The order is the reverse of the order in which tests are run.
|
|
57
|
|
58 FILE is a string naming the test file.
|
|
59 SUCCESSES is a non-negative integer, the number of successes.
|
|
60 TESTS is a non-negative integer, the number of tests run.")
|
|
61
|
1425
|
62 (defvar test-harness-risk-infloops nil
|
|
63 "*Non-nil to run tests that may loop infinitely in buggy implementations.")
|
|
64
|
428
|
65 (defvar test-harness-current-file nil)
|
|
66
|
|
67 (defvar emacs-lisp-file-regexp (purecopy "\\.el\\'")
|
|
68 "*Regexp which matches Emacs Lisp source files.")
|
|
69
|
1751
|
70 (defconst test-harness-file-summary-template
|
|
71 (format "%%-%ds %%%dd of %%%dd tests successful (%%3d%%%%)."
|
|
72 (length "byte-compiler-tests.el:") ; use the longest file name
|
|
73 5
|
|
74 5)
|
|
75 "Format for summary lines printed after each file is run.")
|
|
76
|
|
77 (defconst test-harness-null-summary-template
|
|
78 (format "%%-%ds No tests run."
|
|
79 (length "byte-compiler-tests.el:")) ; use the longest file name
|
|
80 "Format for \"No tests\" lines printed after a file is run.")
|
|
81
|
428
|
82 ;;;###autoload
|
|
83 (defun test-emacs-test-file (filename)
|
|
84 "Test a file of Lisp code named FILENAME.
|
|
85 The output file's name is made by appending `c' to the end of FILENAME."
|
|
86 (interactive
|
|
87 (let ((file buffer-file-name)
|
|
88 (file-name nil)
|
|
89 (file-dir nil))
|
|
90 (and file
|
|
91 (eq (cdr (assq 'major-mode (buffer-local-variables)))
|
|
92 'emacs-lisp-mode)
|
|
93 (setq file-name (file-name-nondirectory file)
|
|
94 file-dir (file-name-directory file)))
|
|
95 (list (read-file-name "Test file: " file-dir nil nil file-name))))
|
|
96 ;; Expand now so we get the current buffer's defaults
|
|
97 (setq filename (expand-file-name filename))
|
|
98
|
|
99 ;; If we're testing a file that's in a buffer and is modified, offer
|
|
100 ;; to save it first.
|
|
101 (or noninteractive
|
|
102 (let ((b (get-file-buffer (expand-file-name filename))))
|
|
103 (if (and b (buffer-modified-p b)
|
|
104 (y-or-n-p (format "save buffer %s first? " (buffer-name b))))
|
|
105 (save-excursion (set-buffer b) (save-buffer)))))
|
|
106
|
|
107 (if (or noninteractive test-harness-verbose)
|
|
108 (message "Testing %s..." filename))
|
|
109 (let ((test-harness-current-file filename)
|
|
110 input-buffer)
|
|
111 (save-excursion
|
|
112 (setq input-buffer (get-buffer-create " *Test Input*"))
|
|
113 (set-buffer input-buffer)
|
|
114 (erase-buffer)
|
|
115 (insert-file-contents filename)
|
|
116 ;; Run hooks including the uncompression hook.
|
|
117 ;; If they change the file name, then change it for the output also.
|
|
118 (let ((buffer-file-name filename)
|
|
119 (default-major-mode 'emacs-lisp-mode)
|
|
120 (enable-local-eval nil))
|
|
121 (normal-mode)
|
|
122 (setq filename buffer-file-name)))
|
|
123 (test-harness-from-buffer input-buffer filename)
|
|
124 (kill-buffer input-buffer)
|
|
125 ))
|
|
126
|
|
127 (defun test-harness-read-from-buffer (buffer)
|
|
128 "Read forms from BUFFER, and turn it into a lambda test form."
|
|
129 (let ((body nil))
|
|
130 (goto-char (point-min) buffer)
|
|
131 (condition-case error-info
|
|
132 (while t
|
|
133 (setq body (cons (read buffer) body)))
|
|
134 (end-of-file nil)
|
|
135 (error
|
1751
|
136 (princ (format "Unexpected error %S reading forms from buffer\n"
|
|
137 error-info))))
|
428
|
138 `(lambda ()
|
|
139 (defvar passes)
|
|
140 (defvar assertion-failures)
|
|
141 (defvar no-error-failures)
|
|
142 (defvar wrong-error-failures)
|
|
143 (defvar missing-message-failures)
|
|
144 (defvar other-failures)
|
|
145
|
|
146 (defvar unexpected-test-suite-failure)
|
|
147 (defvar trick-optimizer)
|
|
148
|
|
149 ,@(nreverse body))))
|
|
150
|
|
151 (defun test-harness-from-buffer (inbuffer filename)
|
|
152 "Run tests in buffer INBUFFER, visiting FILENAME."
|
|
153 (defvar trick-optimizer)
|
|
154 (let ((passes 0)
|
|
155 (assertion-failures 0)
|
|
156 (no-error-failures 0)
|
|
157 (wrong-error-failures 0)
|
|
158 (missing-message-failures 0)
|
|
159 (other-failures 0)
|
|
160
|
973
|
161 ;; #### perhaps this should be a defvar, and output at the very end
|
|
162 ;; OTOH, this way AC types can use a null EMACSPACKAGEPATH to find
|
|
163 ;; what stuff is needed, and ways to avoid using them
|
|
164 (skipped-test-reasons (make-hash-table :test 'equal))
|
|
165
|
428
|
166 (trick-optimizer nil)
|
|
167 (unexpected-test-suite-failure nil)
|
826
|
168 (debug-on-error t)
|
|
169 (pass-stream nil))
|
428
|
170 (with-output-to-temp-buffer "*Test-Log*"
|
826
|
171 (princ (format "Testing %s...\n\n" filename))
|
1095
|
172
|
1413
|
173 (defconst test-harness-failure-tag "FAIL")
|
|
174 (defconst test-harness-success-tag "PASS")
|
1095
|
175
|
|
176 (defmacro Known-Bug-Expect-Failure (&rest body)
|
1413
|
177 `(let ((test-harness-failure-tag "KNOWN BUG")
|
|
178 (test-harness-success-tag "PASS (FAILURE EXPECTED)"))
|
|
179 ,@body))
|
|
180
|
|
181 (defmacro Implementation-Incomplete-Expect-Failure (&rest body)
|
|
182 `(let ((test-harness-failure-tag "IMPLEMENTATION INCOMPLETE")
|
|
183 (test-harness-success-tag "PASS (FAILURE EXPECTED)"))
|
|
184 ,@body))
|
826
|
185
|
|
186 (defun Print-Failure (fmt &rest args)
|
1413
|
187 (setq fmt (format "%s: %s" test-harness-failure-tag fmt))
|
826
|
188 (if (noninteractive) (apply #'message fmt args))
|
|
189 (princ (concat (apply #'format fmt args) "\n")))
|
|
190
|
|
191 (defun Print-Pass (fmt &rest args)
|
1413
|
192 (setq fmt (format "%s: %s" test-harness-success-tag fmt))
|
826
|
193 (and test-harness-verbose
|
|
194 (princ (concat (apply #'format fmt args) "\n"))))
|
|
195
|
973
|
196 (defun Print-Skip (test reason &optional fmt &rest args)
|
1095
|
197 (setq fmt (concat "SKIP: %S BECAUSE %S" fmt))
|
973
|
198 (princ (concat (apply #'format fmt test reason args) "\n")))
|
|
199
|
1095
|
200 (defmacro Skip-Test-Unless (condition reason description &rest body)
|
|
201 "Unless CONDITION is satisfied, skip test BODY.
|
|
202 REASON is a description of the condition failure, and must be unique (it
|
|
203 is used as a hash key). DESCRIPTION describes the tests that were skipped.
|
|
204 BODY is a sequence of expressions and may contain several tests."
|
|
205 `(if (not ,condition)
|
|
206 (let ((count (gethash ,reason skipped-test-reasons)))
|
|
207 (puthash ,reason (if (null count) 1 (1+ count))
|
|
208 skipped-test-reasons)
|
|
209 (Print-Skip ,description ,reason))
|
|
210 ,@body))
|
428
|
211
|
|
212 (defmacro Assert (assertion)
|
|
213 `(condition-case error-info
|
|
214 (progn
|
|
215 (assert ,assertion)
|
826
|
216 (Print-Pass "%S" (quote ,assertion))
|
428
|
217 (incf passes))
|
|
218 (cl-assertion-failed
|
826
|
219 (Print-Failure "Assertion failed: %S" (quote ,assertion))
|
428
|
220 (incf assertion-failures))
|
826
|
221 (t (Print-Failure "%S ==> error: %S" (quote ,assertion) error-info)
|
428
|
222 (incf other-failures)
|
|
223 )))
|
|
224
|
|
225 (defmacro Check-Error (expected-error &rest body)
|
|
226 (let ((quoted-body (if (= 1 (length body))
|
|
227 `(quote ,(car body)) `(quote (progn ,@body)))))
|
|
228 `(condition-case error-info
|
|
229 (progn
|
|
230 (setq trick-optimizer (progn ,@body))
|
826
|
231 (Print-Failure "%S executed successfully, but expected error %S"
|
428
|
232 ,quoted-body
|
826
|
233 ',expected-error)
|
428
|
234 (incf no-error-failures))
|
|
235 (,expected-error
|
826
|
236 (Print-Pass "%S ==> error %S, as expected"
|
|
237 ,quoted-body ',expected-error)
|
428
|
238 (incf passes))
|
|
239 (error
|
826
|
240 (Print-Failure "%S ==> expected error %S, got error %S instead"
|
|
241 ,quoted-body ',expected-error error-info)
|
428
|
242 (incf wrong-error-failures)))))
|
|
243
|
826
|
244 (defmacro Check-Error-Message (expected-error expected-error-regexp
|
|
245 &rest body)
|
428
|
246 (let ((quoted-body (if (= 1 (length body))
|
|
247 `(quote ,(car body)) `(quote (progn ,@body)))))
|
|
248 `(condition-case error-info
|
|
249 (progn
|
|
250 (setq trick-optimizer (progn ,@body))
|
826
|
251 (Print-Failure "%S executed successfully, but expected error %S"
|
|
252 ,quoted-body ',expected-error)
|
428
|
253 (incf no-error-failures))
|
|
254 (,expected-error
|
|
255 (let ((error-message (second error-info)))
|
|
256 (if (string-match ,expected-error-regexp error-message)
|
|
257 (progn
|
826
|
258 (Print-Pass "%S ==> error %S %S, as expected"
|
|
259 ,quoted-body error-message ',expected-error)
|
428
|
260 (incf passes))
|
826
|
261 (Print-Failure "%S ==> got error %S as expected, but error message %S did not match regexp %S"
|
|
262 ,quoted-body ',expected-error error-message ,expected-error-regexp)
|
428
|
263 (incf wrong-error-failures))))
|
|
264 (error
|
826
|
265 (Print-Failure "%S ==> expected error %S, got error %S instead"
|
|
266 ,quoted-body ',expected-error error-info)
|
428
|
267 (incf wrong-error-failures)))))
|
|
268
|
|
269
|
|
270 (defmacro Check-Message (expected-message-regexp &rest body)
|
1095
|
271 (Skip-Test-Unless (fboundp 'defadvice)
|
|
272 "can't defadvice"
|
|
273 expected-message-regexp
|
973
|
274 (let ((quoted-body (if (= 1 (length body))
|
|
275 `(quote ,(car body))
|
|
276 `(quote (progn ,@body)))))
|
|
277 `(let ((messages ""))
|
|
278 (defadvice message (around collect activate)
|
|
279 (defvar messages)
|
|
280 (let ((msg-string (apply 'format (ad-get-args 0))))
|
|
281 (setq messages (concat messages msg-string))
|
|
282 msg-string))
|
|
283 (condition-case error-info
|
|
284 (progn
|
|
285 (setq trick-optimizer (progn ,@body))
|
|
286 (if (string-match ,expected-message-regexp messages)
|
|
287 (progn
|
|
288 (Print-Pass "%S ==> value %S, message %S, matching %S, as expected"
|
|
289 ,quoted-body trick-optimizer messages ',expected-message-regexp)
|
|
290 (incf passes))
|
|
291 (Print-Failure "%S ==> value %S, message %S, NOT matching expected %S"
|
|
292 ,quoted-body trick-optimizer messages
|
|
293 ',expected-message-regexp)
|
|
294 (incf missing-message-failures)))
|
|
295 (error
|
|
296 (Print-Failure "%S ==> unexpected error %S"
|
|
297 ,quoted-body error-info)
|
|
298 (incf other-failures)))
|
|
299 (ad-unadvise 'message)))))
|
428
|
300
|
|
301 (defmacro Ignore-Ebola (&rest body)
|
|
302 `(let ((debug-issue-ebola-notices -42)) ,@body))
|
|
303
|
|
304 (defun Int-to-Marker (pos)
|
|
305 (save-excursion
|
|
306 (set-buffer standard-output)
|
|
307 (save-excursion
|
|
308 (goto-char pos)
|
|
309 (point-marker))))
|
|
310
|
|
311 (princ "Testing Interpreted Lisp\n\n")
|
|
312 (condition-case error-info
|
|
313 (funcall (test-harness-read-from-buffer inbuffer))
|
|
314 (error
|
|
315 (setq unexpected-test-suite-failure t)
|
|
316 (princ (format "Unexpected error %S while executing interpreted code\n"
|
|
317 error-info))
|
|
318 (message "Unexpected error %S while executing interpreted code." error-info)
|
|
319 (message "Test suite execution aborted." error-info)
|
|
320 ))
|
|
321 (princ "\nTesting Compiled Lisp\n\n")
|
1758
|
322 (let (code
|
|
323 (test-harness-test-compiled t))
|
428
|
324 (condition-case error-info
|
446
|
325 (setq code
|
|
326 ;; our lisp code is often intentionally dubious,
|
|
327 ;; so throw away _all_ the byte compiler warnings.
|
|
328 (letf (((symbol-function 'byte-compile-warn) 'ignore))
|
|
329 (byte-compile (test-harness-read-from-buffer inbuffer))))
|
428
|
330 (error
|
|
331 (princ (format "Unexpected error %S while byte-compiling code\n"
|
|
332 error-info))))
|
|
333 (condition-case error-info
|
|
334 (if code (funcall code))
|
|
335 (error
|
|
336 (princ (format "Unexpected error %S while executing byte-compiled code\n"
|
|
337 error-info))
|
|
338 (message "Unexpected error %S while executing byte-compiled code." error-info)
|
|
339 (message "Test suite execution aborted." error-info)
|
|
340 )))
|
826
|
341 (princ (format "\nSUMMARY for %s:\n" filename))
|
428
|
342 (princ (format "\t%5d passes\n" passes))
|
|
343 (princ (format "\t%5d assertion failures\n" assertion-failures))
|
|
344 (princ (format "\t%5d errors that should have been generated, but weren't\n" no-error-failures))
|
|
345 (princ (format "\t%5d wrong-error failures\n" wrong-error-failures))
|
|
346 (princ (format "\t%5d missing-message failures\n" missing-message-failures))
|
|
347 (princ (format "\t%5d other failures\n" other-failures))
|
|
348 (let* ((total (+ passes
|
|
349 assertion-failures
|
|
350 no-error-failures
|
|
351 wrong-error-failures
|
|
352 missing-message-failures
|
|
353 other-failures))
|
|
354 (basename (file-name-nondirectory filename))
|
|
355 (summary-msg
|
|
356 (if (> total 0)
|
1751
|
357 (format test-harness-file-summary-template
|
|
358 (concat basename ":")
|
|
359 passes total (/ (* 100 passes) total))
|
|
360 (format test-harness-null-summary-template
|
|
361 (concat basename ":"))))
|
973
|
362 (reasons ""))
|
|
363 (maphash (lambda (key value)
|
|
364 (setq reasons
|
|
365 (concat reasons
|
1095
|
366 (format "\n %d tests skipped because %s."
|
973
|
367 value key))))
|
|
368 skipped-test-reasons)
|
|
369 (when (> (length reasons) 1)
|
|
370 (setq summary-msg (concat summary-msg reasons "
|
|
371 Probably XEmacs cannot find your installed packages. Set EMACSPACKAGEPATH
|
|
372 to the package hierarchy root or configure with --package-path to enable
|
|
373 the skipped tests.")))
|
1719
|
374 (setq test-harness-file-results-alist
|
|
375 (cons (list filename passes total)
|
|
376 test-harness-file-results-alist))
|
428
|
377 (message "%s" summary-msg))
|
|
378 (when unexpected-test-suite-failure
|
|
379 (message "Test suite execution failed unexpectedly."))
|
|
380 (fmakunbound 'Assert)
|
|
381 (fmakunbound 'Check-Error)
|
863
|
382 (fmakunbound 'Check-Message)
|
|
383 (fmakunbound 'Check-Error-Message)
|
428
|
384 (fmakunbound 'Ignore-Ebola)
|
|
385 (fmakunbound 'Int-to-Marker)
|
1719
|
386 (and noninteractive
|
|
387 (message "%s" (buffer-substring-no-properties
|
1751
|
388 nil nil "*Test-Log*")))
|
|
389 )))
|
428
|
390
|
|
391 (defvar test-harness-results-point-max nil)
|
|
392 (defmacro displaying-emacs-test-results (&rest body)
|
|
393 `(let ((test-harness-results-point-max test-harness-results-point-max))
|
|
394 ;; Log the file name.
|
|
395 (test-harness-log-file)
|
|
396 ;; Record how much is logged now.
|
|
397 ;; We will display the log buffer if anything more is logged
|
|
398 ;; before the end of BODY.
|
|
399 (or test-harness-results-point-max
|
|
400 (save-excursion
|
|
401 (set-buffer (get-buffer-create "*Test-Log*"))
|
|
402 (setq test-harness-results-point-max (point-max))))
|
|
403 (unwind-protect
|
|
404 (condition-case error-info
|
|
405 (progn ,@body)
|
|
406 (error
|
|
407 (test-harness-report-error error-info)))
|
|
408 (save-excursion
|
|
409 ;; If there were compilation warnings, display them.
|
|
410 (set-buffer "*Test-Log*")
|
|
411 (if (= test-harness-results-point-max (point-max))
|
|
412 nil
|
|
413 (if temp-buffer-show-function
|
|
414 (let ((show-buffer (get-buffer-create "*Test-Log-Show*")))
|
|
415 (save-excursion
|
|
416 (set-buffer show-buffer)
|
|
417 (setq buffer-read-only nil)
|
|
418 (erase-buffer))
|
|
419 (copy-to-buffer show-buffer
|
|
420 (save-excursion
|
|
421 (goto-char test-harness-results-point-max)
|
|
422 (forward-line -1)
|
|
423 (point))
|
|
424 (point-max))
|
|
425 (funcall temp-buffer-show-function show-buffer))
|
|
426 (select-window
|
|
427 (prog1 (selected-window)
|
|
428 (select-window (display-buffer (current-buffer)))
|
|
429 (goto-char test-harness-results-point-max)
|
|
430 (recenter 1)))))))))
|
|
431
|
|
432 (defun batch-test-emacs-1 (file)
|
|
433 (condition-case error-info
|
|
434 (progn (test-emacs-test-file file) t)
|
|
435 (error
|
|
436 (princ ">>Error occurred processing ")
|
|
437 (princ file)
|
|
438 (princ ": ")
|
|
439 (display-error error-info nil)
|
|
440 (terpri)
|
|
441 nil)))
|
|
442
|
|
443 (defun batch-test-emacs ()
|
|
444 "Run `test-harness' on the files remaining on the command line.
|
|
445 Use this from the command line, with `-batch';
|
|
446 it won't work in an interactive Emacs.
|
|
447 Each file is processed even if an error occurred previously.
|
|
448 For example, invoke \"xemacs -batch -f batch-test-emacs tests/*.el\""
|
|
449 ;; command-line-args-left is what is left of the command line (from
|
|
450 ;; startup.el)
|
|
451 (defvar command-line-args-left) ;Avoid 'free variable' warning
|
|
452 (defvar debug-issue-ebola-notices)
|
|
453 (if (not noninteractive)
|
|
454 (error "`batch-test-emacs' is to be used only with -batch"))
|
|
455 (let ((error nil))
|
|
456 (dolist (file command-line-args-left)
|
|
457 (if (file-directory-p file)
|
|
458 (dolist (file-in-dir (directory-files file t))
|
|
459 (when (and (string-match emacs-lisp-file-regexp file-in-dir)
|
|
460 (not (or (auto-save-file-name-p file-in-dir)
|
|
461 (backup-file-name-p file-in-dir)
|
|
462 (equal (file-name-nondirectory file-in-dir)
|
|
463 "test-harness.el"))))
|
|
464 (or (batch-test-emacs-1 file-in-dir)
|
|
465 (setq error t))))
|
|
466 (or (batch-test-emacs-1 file)
|
|
467 (setq error t))))
|
1719
|
468 (let ((namelen 0)
|
|
469 (succlen 0)
|
|
470 (testlen 0)
|
|
471 (results test-harness-file-results-alist))
|
|
472 ;; compute maximum lengths of variable components of report
|
|
473 ;; probably should just use (length "byte-compiler-tests.el")
|
|
474 ;; and 5-place sizes -- this will also work for the file-by-file
|
|
475 ;; printing when Adrian's kludge gets reverted
|
|
476 (flet ((print-width (i)
|
|
477 (let ((x 10) (y 1))
|
|
478 (while (>= i x)
|
|
479 (setq x (* 10 x) y (1+ y)))
|
|
480 y)))
|
|
481 (while results
|
|
482 (let* ((head (car results))
|
|
483 (nn (length (file-name-nondirectory (first head))))
|
|
484 (ss (print-width (second head)))
|
|
485 (tt (print-width (third head))))
|
|
486 (when (> nn namelen) (setq namelen nn))
|
|
487 (when (> ss succlen) (setq succlen ss))
|
|
488 (when (> tt testlen) (setq testlen tt)))
|
|
489 (setq results (cdr results))))
|
|
490 ;; create format and print
|
1751
|
491 (let ((results (reverse test-harness-file-results-alist)))
|
1719
|
492 (while results
|
|
493 (let* ((head (car results))
|
1751
|
494 (basename (file-name-nondirectory (first head)))
|
1719
|
495 (nsucc (second head))
|
|
496 (ntest (third head)))
|
1722
|
497 (if (> ntest 0)
|
1751
|
498 (message test-harness-file-summary-template
|
|
499 (concat basename ":")
|
1722
|
500 nsucc
|
|
501 ntest
|
|
502 (/ (* 100 nsucc) ntest))
|
1751
|
503 (message test-harness-null-summary-template
|
|
504 (concat basename ":")))
|
1719
|
505 (setq results (cdr results))))))
|
|
506 (message "\nDone")
|
428
|
507 (kill-emacs (if error 1 0))))
|
|
508
|
|
509 (provide 'test-harness)
|
|
510
|
|
511 ;;; test-harness.el ends here
|