Skip to content

Commit

Permalink
add function to run tests in eshell
Browse files Browse the repository at this point in the history
  • Loading branch information
jrockway committed Feb 1, 2010
1 parent 81a6015 commit bf76f16
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion _local/cperl-extras.el
Expand Up @@ -8,10 +8,20 @@
(require 'cperl-project)
(require 'cperl-moose)
(require 'cperl-reindent)
(provide 'cperl-extras)

(defun cperl-run-tests-in-eshell (&optional prefix)
(interactive "p")
(let ((eshell-buf (eproject-eshell-cd-here prefix)))
(with-current-buffer eshell-buf
(goto-char (point-max))
(eshell-preinput-scroll-to-bottom)
(insert "prove --lib t")
(eshell-send-input nil t)
(eshell-postoutput-scroll-to-bottom))))

(add-hook 'cperl-mode-hook
(lambda ()
(local-set-key (kbd "C-c C-l") 'cperl-run-tests-in-eshell)
(local-set-key "\C-ct" 'increment-test-counter)
(local-set-key "\C-cu" 'add-use)
(local-set-key "\C-cmu" 'add-Makefile.PL-requires)
Expand All @@ -32,3 +42,5 @@
(local-set-key "\C-c\C-f" 'ifind-perl-project-file)))

(global-set-key "\C-c\C-p" 'ifind-perl-projects)

(provide 'cperl-extras)

0 comments on commit bf76f16

Please sign in to comment.