diff options
| author | Glenn Morris | 2012-04-10 20:24:26 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-04-10 20:24:26 -0700 |
| commit | ab7ce8c15532d179579bb8a36e221b4d96840a2f (patch) | |
| tree | ccfa1a00b238b116a5cf8b7bf8e9c13ffed79b2a | |
| parent | de8c03dc519ca124da1b410f744b3a69531fb79b (diff) | |
| download | emacs-ab7ce8c15532d179579bb8a36e221b4d96840a2f.tar.gz emacs-ab7ce8c15532d179579bb8a36e221b4d96840a2f.zip | |
Add another vc-bzr test
* lisp/vc/vc-bzr.el (vc-bzr-status): Avoid condition-case-unless-debug.
* test/automated/vc-bzr.el (vc-bzr-test-faulty-bzr-autoloads): New test.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-bzr.el | 6 | ||||
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/vc-bzr.el | 29 |
4 files changed, 41 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index caaab6d5a61..75ea616e0b5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-04-11 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * vc/vc-bzr.el (vc-bzr-status): Avoid condition-case-unless-debug. | ||
| 4 | |||
| 1 | 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * window.el (window--state-get-1): Obey window-point-insertion-type. | 7 | * window.el (window--state-get-1): Obey window-point-insertion-type. |
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 34d11cf359f..505e40f46ba 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el | |||
| @@ -410,7 +410,11 @@ in the branch repository (or whose status not be determined)." | |||
| 410 | ;; (unchanged . WARNING). FIXME unchanged is not the best status to | 410 | ;; (unchanged . WARNING). FIXME unchanged is not the best status to |
| 411 | ;; return in case of error. | 411 | ;; return in case of error. |
| 412 | (with-temp-buffer | 412 | (with-temp-buffer |
| 413 | (with-demoted-errors (vc-bzr-command "status" t 0 file)) | 413 | ;; This is with-demoted-errors without the condition-case-unless-debug |
| 414 | ;; annoyance, which makes it fail during ert testing. | ||
| 415 | (let (err) | ||
| 416 | (condition-case err (vc-bzr-command "status" t 0 file) | ||
| 417 | (error (message "Error: %S" err) nil))) | ||
| 414 | (let ((status 'unchanged)) | 418 | (let ((status 'unchanged)) |
| 415 | ;; the only secure status indication in `bzr status' output | 419 | ;; the only secure status indication in `bzr status' output |
| 416 | ;; is a couple of lines following the pattern:: | 420 | ;; is a couple of lines following the pattern:: |
diff --git a/test/ChangeLog b/test/ChangeLog index f44b09102d9..66f8592c79c 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-04-11 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * automated/vc-bzr.el (vc-bzr-test-faulty-bzr-autoloads): New test. | ||
| 4 | |||
| 1 | 2012-02-13 Teodor Zlatanov <tzz@lifelogs.com> | 5 | 2012-02-13 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 6 | ||
| 3 | * automated/url-future-tests.el (url-future-tests): Move from | 7 | * automated/url-future-tests.el (url-future-tests): Move from |
diff --git a/test/automated/vc-bzr.el b/test/automated/vc-bzr.el index 904ab4d1304..94f8502b882 100644 --- a/test/automated/vc-bzr.el +++ b/test/automated/vc-bzr.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; vc-bzr.el --- tests for vc/vc-bzr.el | 1 | ;;; vc-bzr.el --- tests for vc/vc-bzr.el |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2011-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Glenn Morris <rgm@gnu.org> | 5 | ;; Author: Glenn Morris <rgm@gnu.org> |
| 6 | 6 | ||
| @@ -98,4 +98,31 @@ | |||
| 98 | (should (get-buffer "*vc-log*"))) | 98 | (should (get-buffer "*vc-log*"))) |
| 99 | (delete-directory tempdir t)))) | 99 | (delete-directory tempdir t)))) |
| 100 | 100 | ||
| 101 | ;; http://lists.gnu.org/archive/html/help-gnu-emacs/2012-04/msg00145.html | ||
| 102 | (ert-deftest vc-bzr-test-faulty-bzr-autoloads () | ||
| 103 | "Test we can generate autoloads in a bzr directory when bzr is faulty." | ||
| 104 | :expected-result (if (executable-find vc-bzr-program) :passed :failed) | ||
| 105 | (should (executable-find vc-bzr-program)) | ||
| 106 | (let* ((tempdir (make-temp-file "vc-bzr-test" t)) | ||
| 107 | (file (expand-file-name "foo.el" tempdir)) | ||
| 108 | (default-directory (file-name-as-directory tempdir)) | ||
| 109 | (generated-autoload-file (expand-file-name "loaddefs.el" tempdir))) | ||
| 110 | (unwind-protect | ||
| 111 | (progn | ||
| 112 | (call-process vc-bzr-program nil nil nil "init") | ||
| 113 | (with-temp-buffer | ||
| 114 | (insert ";;;###autoload | ||
| 115 | \(defun foo () \"foo\" (interactive) (message \"foo!\"))") | ||
| 116 | (write-region nil nil file nil 'silent)) | ||
| 117 | (call-process vc-bzr-program nil nil nil "add") | ||
| 118 | (call-process vc-bzr-program nil nil nil "commit" "-m" "Commit 1") | ||
| 119 | ;; Deleting dirstate ensures both that vc-bzr's status heuristic | ||
| 120 | ;; fails, so it has to call the external bzr status, and | ||
| 121 | ;; causes bzr status to fail. This simulates a broken bzr | ||
| 122 | ;; installation. | ||
| 123 | (delete-file ".bzr/checkout/dirstate") | ||
| 124 | (should (progn (update-directory-autoloads default-directory) | ||
| 125 | t))) | ||
| 126 | (delete-directory tempdir t)))) | ||
| 127 | |||
| 101 | ;;; vc-bzr.el ends here | 128 | ;;; vc-bzr.el ends here |