diff options
author | Glenn Morris <[email protected]> | 2012-04-10 20:24:26 -0700 |
---|---|---|
committer | Glenn Morris <[email protected]> | 2012-04-10 20:24:26 -0700 |
commit | ab7ce8c15532d179579bb8a36e221b4d96840a2f (patch) | |
tree | ccfa1a00b238b116a5cf8b7bf8e9c13ffed79b2a /test | |
parent | de8c03dc519ca124da1b410f744b3a69531fb79b (diff) |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 4 | ||||
-rw-r--r-- | test/automated/vc-bzr.el | 29 |
2 files changed, 32 insertions, 1 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index f44b09102d..66f8592c79 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2012-04-11 Glenn Morris <[email protected]> + + * automated/vc-bzr.el (vc-bzr-test-faulty-bzr-autoloads): New test. + 2012-02-13 Teodor Zlatanov <[email protected]> * 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 904ab4d130..94f8502b88 100644 --- a/test/automated/vc-bzr.el +++ b/test/automated/vc-bzr.el @@ -1,6 +1,6 @@ ;;; vc-bzr.el --- tests for vc/vc-bzr.el -;; Copyright (C) 2011-2012 Free Software Foundation, Inc. +;; Copyright (C) 2011-2012 Free Software Foundation, Inc. ;; Author: Glenn Morris <[email protected]> @@ -98,4 +98,31 @@ (should (get-buffer "*vc-log*"))) (delete-directory tempdir t)))) +;; http://lists.gnu.org/archive/html/help-gnu-emacs/2012-04/msg00145.html +(ert-deftest vc-bzr-test-faulty-bzr-autoloads () + "Test we can generate autoloads in a bzr directory when bzr is faulty." + :expected-result (if (executable-find vc-bzr-program) :passed :failed) + (should (executable-find vc-bzr-program)) + (let* ((tempdir (make-temp-file "vc-bzr-test" t)) + (file (expand-file-name "foo.el" tempdir)) + (default-directory (file-name-as-directory tempdir)) + (generated-autoload-file (expand-file-name "loaddefs.el" tempdir))) + (unwind-protect + (progn + (call-process vc-bzr-program nil nil nil "init") + (with-temp-buffer + (insert ";;;###autoload +\(defun foo () \"foo\" (interactive) (message \"foo!\"))") + (write-region nil nil file nil 'silent)) + (call-process vc-bzr-program nil nil nil "add") + (call-process vc-bzr-program nil nil nil "commit" "-m" "Commit 1") + ;; Deleting dirstate ensures both that vc-bzr's status heuristic + ;; fails, so it has to call the external bzr status, and + ;; causes bzr status to fail. This simulates a broken bzr + ;; installation. + (delete-file ".bzr/checkout/dirstate") + (should (progn (update-directory-autoloads default-directory) + t))) + (delete-directory tempdir t)))) + ;;; vc-bzr.el ends here |