]> git.eshelyaron.com Git - emacs.git/commitdiff
package-test tweaks for hydra
authorGlenn Morris <rgm@gnu.org>
Wed, 1 Oct 2014 23:24:28 +0000 (19:24 -0400)
committerGlenn Morris <rgm@gnu.org>
Wed, 1 Oct 2014 23:24:28 +0000 (19:24 -0400)
* test/automated/package-test.el (with-package-test, package-test-signed):
Also set HOME to a temp value, in case the real one is absent (e.g.
hydra) or read-only.
(package-test-signed): Use skip-unless rather than expected-result.

Fixes: debbugs:18575
test/ChangeLog
test/automated/package-test.el

index dcab604dbb10a5d45ebeb855c3ed5db2c1bc1c14..264173fa557d62fffe8c765c7c2d8f271f8eb651 100644 (file)
@@ -1,3 +1,10 @@
+2014-10-01  Glenn Morris  <rgm@gnu.org>
+
+       * automated/package-test.el (with-package-test, package-test-signed):
+       Also set HOME to a temp value, in case the real one is absent (e.g.
+       hydra) or read-only.  (Bug#18575)
+       (package-test-signed): Use skip-unless rather than expected-result.
+
 2014-09-01  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        * automated/python-tests.el:
index 65e13438ea14edab72e23021a3817e103f48814d..f21e1421a8dd3d92df70927729bd67ddf5ff9dd9 100644 (file)
@@ -89,6 +89,8 @@
   "Set up temporary locations and variables for testing."
   (declare (indent 1))
   `(let* ((package-test-user-dir (make-temp-file "pkg-test-user-dir-" t))
+          (process-environment (cons (format "HOME=%s" package-test-user-dir)
+                                     process-environment))
           (package-user-dir package-test-user-dir)
           (package-archives `(("gnu" . ,package-test-data-dir)))
           (old-yes-no-defn (symbol-function 'yes-or-no-p))
@@ -360,11 +362,15 @@ Must called from within a `tar-mode' buffer."
 
 (ert-deftest package-test-signed ()
   "Test verifying package signature."
-  :expected-result (condition-case nil
-                      (progn
+  (skip-unless (ignore-errors
+                (let ((homedir (make-temp-file "package-test" t)))
+                  (unwind-protect
+                      (let ((process-environment
+                             (cons (format "HOME=%s" homedir)
+                                   process-environment)))
                         (epg-check-configuration (epg-configuration))
-                        :passed)
-                    (error :failed))
+                        t)
+                    (delete-directory homedir t)))))
   (let* ((keyring (expand-file-name "key.pub" package-test-data-dir))
         (package-test-data-dir
           (expand-file-name "data/package/signed" package-test-file-dir)))