Mercurial > dotfiles
comparison .elisp/nose.el @ 80:423b8666e6f6
Latest nose.el from nosemacs.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 10 Apr 2009 11:18:22 -0500 |
parents | 2b2a667092fd |
children | f013f40e7b63 |
comparison
equal
deleted
inserted
replaced
79:26f1ccac509c | 80:423b8666e6f6 |
---|---|
40 (defvar nose-project-names '("eco/bin/test")) | 40 (defvar nose-project-names '("eco/bin/test")) |
41 (defvar nose-global-name "nosetests") | 41 (defvar nose-global-name "nosetests") |
42 | 42 |
43 (defun run-nose (&optional tests debug) | 43 (defun run-nose (&optional tests debug) |
44 "run nosetests" | 44 "run nosetests" |
45 (interactive) | |
46 | |
47 (let* ((nose (nose-find-test-runner)) | 45 (let* ((nose (nose-find-test-runner)) |
48 (where (expand-file-name "../.." (file-name-directory nose))) | 46 (where (expand-file-name "../.." (file-name-directory nose))) |
49 (args (if debug "--pdb" "")) | 47 (args (if debug "--pdb" "")) |
50 (tnames (if tests tests ""))) | 48 (tnames (if tests tests ""))) |
51 (print nose) | 49 (funcall (if debug 'pdb '(lambda (command) |
52 (print args) | 50 (compilation-start command |
53 (print tnames) | 51 nil |
54 (funcall (if debug 'pdb 'compile) | 52 (lambda (mode) (concat "*nosetests*"))))) |
55 (format "%s -v %s -w %s -c %s/setup.cfg %s" | 53 (format "%s -v %s -w %s -c %s/setup.cfg %s" |
56 (nose-find-test-runner) args where where tnames))) | 54 (nose-find-test-runner) args where where tnames))) |
57 ) | 55 ) |
58 | 56 |
59 (defun nosetests-all (&optional debug) | 57 (defun nosetests-all (&optional debug) |
83 (defun nosetests-pdb-one () | 81 (defun nosetests-pdb-one () |
84 (interactive) | 82 (interactive) |
85 (nosetests-one t)) | 83 (nosetests-one t)) |
86 | 84 |
87 (defun nose-find-test-runner () | 85 (defun nose-find-test-runner () |
88 (interactive) | |
89 (message | 86 (message |
90 (let ((result (reduce '(lambda (x y) (or x y)) | 87 (let ((result (reduce '(lambda (x y) (or x y)) |
91 (mapcar 'nose-find-test-runner-names nose-project-names)))) | 88 (mapcar 'nose-find-test-runner-names nose-project-names)))) |
92 (if result | 89 (if result |
93 result | 90 result |
104 (t (nose-find-test-runner-in-dir-named | 101 (t (nose-find-test-runner-in-dir-named |
105 (file-name-directory (directory-file-name dn)) | 102 (file-name-directory (directory-file-name dn)) |
106 runner))))) | 103 runner))))) |
107 | 104 |
108 (defun nose-py-testable () | 105 (defun nose-py-testable () |
109 (interactive) | |
110 (let ((remember-point (point))) | 106 (let ((remember-point (point))) |
111 (re-search-backward | 107 (re-search-backward |
112 "^ \\{0,4\\}\\(class\\|def\\)[ \t]+\\([a-zA-Z0-9_]+\\)" nil t) | 108 "^ \\{0,4\\}\\(class\\|def\\)[ \t]+\\([a-zA-Z0-9_]+\\)" nil t) |
113 (setq t1 (buffer-substring-no-properties (match-beginning 2) (match-end 2))) | 109 (setq t1 (buffer-substring-no-properties (match-beginning 2) (match-end 2))) |
114 (goto-char remember-point) | 110 (goto-char remember-point) |