aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Eggert2012-04-13 21:37:44 -0700
committerPaul Eggert2012-04-13 21:37:44 -0700
commitbdf35b6a6a78e444563a8e321ccb42b4b4a419bd (patch)
treee96324ace186c7acc92182a255c3aa7ff315b82f /test
parent1530927cb9a3dca7c0f41975f2e9e62ef8be92a2 (diff)
parentd5e6342ed5e408014019c478ce16a47a2aad418b (diff)
downloademacs-bdf35b6a6a78e444563a8e321ccb42b4b4a419bd.tar.gz
emacs-bdf35b6a6a78e444563a8e321ccb42b4b4a419bd.zip
Merge from trunk.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog4
-rw-r--r--test/automated/vc-bzr.el29
2 files changed, 32 insertions, 1 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index f44b09102d9..66f8592c79c 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
12012-04-11 Glenn Morris <rgm@gnu.org>
2
3 * automated/vc-bzr.el (vc-bzr-test-faulty-bzr-autoloads): New test.
4
12012-02-13 Teodor Zlatanov <tzz@lifelogs.com> 52012-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