comparison lisp/emacs-lisp/testcover.el @ 76705:e61171cf2862

(testcover-start, testcover-end, testcover-mark-all, testcover-unmark-all): Add prompts to interactive specs.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 24 Mar 2007 15:53:07 +0000
parents 7a3f13e2dd57
children 935157c0b596 4ef881a120fe
comparison
equal deleted inserted replaced
76704:f3c1d3af8518 76705:e61171cf2862
188 (defun testcover-start (filename &optional byte-compile) 188 (defun testcover-start (filename &optional byte-compile)
189 "Uses edebug to instrument all macros and functions in FILENAME, then 189 "Uses edebug to instrument all macros and functions in FILENAME, then
190 changes the instrumentation from edebug to testcover--much faster, no 190 changes the instrumentation from edebug to testcover--much faster, no
191 problems with type-ahead or post-command-hook, etc. If BYTE-COMPILE is 191 problems with type-ahead or post-command-hook, etc. If BYTE-COMPILE is
192 non-nil, byte-compiles each function after instrumenting." 192 non-nil, byte-compiles each function after instrumenting."
193 (interactive "f") 193 (interactive "fStart covering file: ")
194 (let ((buf (find-file filename)) 194 (let ((buf (find-file filename))
195 (load-read-function 'testcover-read) 195 (load-read-function 'testcover-read)
196 (edebug-all-defs t)) 196 (edebug-all-defs t))
197 (setq edebug-form-data nil 197 (setq edebug-form-data nil
198 testcover-module-constants nil 198 testcover-module-constants nil
426 (when (not x) 426 (when (not x)
427 (setq result nil))))) 427 (setq result nil)))))
428 list) 428 list)
429 result)) 429 result))
430 430
431 (defun testcover-end (buffer) 431 (defun testcover-end (filename)
432 "Turn off instrumentation of all macros and functions in FILENAME." 432 "Turn off instrumentation of all macros and functions in FILENAME."
433 (interactive "b") 433 (interactive "fStop covering file: ")
434 (let ((buf (find-file-noselect buffer))) 434 (let ((buf (find-file-noselect filename)))
435 (eval-buffer buf t))) 435 (eval-buffer buf t)))
436 436
437 437
438 ;;;========================================================================= 438 ;;;=========================================================================
439 ;;; Accumulate coverage data 439 ;;; Accumulate coverage data
511 (set-buffer-modified-p changed)))) 511 (set-buffer-modified-p changed))))
512 512
513 (defun testcover-mark-all (&optional buffer) 513 (defun testcover-mark-all (&optional buffer)
514 "Mark all forms in BUFFER that did not get completley tested during 514 "Mark all forms in BUFFER that did not get completley tested during
515 coverage tests. This function creates many overlays." 515 coverage tests. This function creates many overlays."
516 (interactive "b") 516 (interactive "bMark forms in buffer: ")
517 (if buffer 517 (if buffer
518 (switch-to-buffer buffer)) 518 (switch-to-buffer buffer))
519 (goto-char 1) 519 (goto-char 1)
520 (dolist (x edebug-form-data) 520 (dolist (x edebug-form-data)
521 (if (get (car x) 'edebug) 521 (if (get (car x) 'edebug)
522 (testcover-mark (car x))))) 522 (testcover-mark (car x)))))
523 523
524 (defun testcover-unmark-all (buffer) 524 (defun testcover-unmark-all (buffer)
525 "Remove all overlays from FILENAME." 525 "Remove all overlays from FILENAME."
526 (interactive "b") 526 (interactive "bUnmark forms in buffer: ")
527 (condition-case nil 527 (condition-case nil
528 (progn 528 (progn
529 (set-buffer buffer) 529 (set-buffer buffer)
530 (mapc 'delete-overlay (overlays-in 1 (buffer-size)))) 530 (mapc 'delete-overlay (overlays-in 1 (buffer-size))))
531 (error nil))) ;Ignore "No such buffer" errors 531 (error nil))) ;Ignore "No such buffer" errors