diff options
| author | Glenn Morris | 2014-10-01 19:24:28 -0400 |
|---|---|---|
| committer | Glenn Morris | 2014-10-01 19:24:28 -0400 |
| commit | e694e2a9b05e75a31c209c499400a2cb0fade2e9 (patch) | |
| tree | 5c3c1a72dae07bc1e223311b1175451420de0093 /test | |
| parent | 335e9627ca78f7be9eea27f38a530fd51a1e6995 (diff) | |
| download | emacs-e694e2a9b05e75a31c209c499400a2cb0fade2e9.tar.gz emacs-e694e2a9b05e75a31c209c499400a2cb0fade2e9.zip | |
package-test tweaks for hydra
* 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
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 7 | ||||
| -rw-r--r-- | test/automated/package-test.el | 14 |
2 files changed, 17 insertions, 4 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index dcab604dbb1..264173fa557 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-10-01 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * automated/package-test.el (with-package-test, package-test-signed): | ||
| 4 | Also set HOME to a temp value, in case the real one is absent (e.g. | ||
| 5 | hydra) or read-only. (Bug#18575) | ||
| 6 | (package-test-signed): Use skip-unless rather than expected-result. | ||
| 7 | |||
| 1 | 2014-09-01 Fabián Ezequiel Gallina <fgallina@gnu.org> | 8 | 2014-09-01 Fabián Ezequiel Gallina <fgallina@gnu.org> |
| 2 | 9 | ||
| 3 | * automated/python-tests.el: | 10 | * automated/python-tests.el: |
diff --git a/test/automated/package-test.el b/test/automated/package-test.el index 65e13438ea1..f21e1421a8d 100644 --- a/test/automated/package-test.el +++ b/test/automated/package-test.el | |||
| @@ -89,6 +89,8 @@ | |||
| 89 | "Set up temporary locations and variables for testing." | 89 | "Set up temporary locations and variables for testing." |
| 90 | (declare (indent 1)) | 90 | (declare (indent 1)) |
| 91 | `(let* ((package-test-user-dir (make-temp-file "pkg-test-user-dir-" t)) | 91 | `(let* ((package-test-user-dir (make-temp-file "pkg-test-user-dir-" t)) |
| 92 | (process-environment (cons (format "HOME=%s" package-test-user-dir) | ||
| 93 | process-environment)) | ||
| 92 | (package-user-dir package-test-user-dir) | 94 | (package-user-dir package-test-user-dir) |
| 93 | (package-archives `(("gnu" . ,package-test-data-dir))) | 95 | (package-archives `(("gnu" . ,package-test-data-dir))) |
| 94 | (old-yes-no-defn (symbol-function 'yes-or-no-p)) | 96 | (old-yes-no-defn (symbol-function 'yes-or-no-p)) |
| @@ -360,11 +362,15 @@ Must called from within a `tar-mode' buffer." | |||
| 360 | 362 | ||
| 361 | (ert-deftest package-test-signed () | 363 | (ert-deftest package-test-signed () |
| 362 | "Test verifying package signature." | 364 | "Test verifying package signature." |
| 363 | :expected-result (condition-case nil | 365 | (skip-unless (ignore-errors |
| 364 | (progn | 366 | (let ((homedir (make-temp-file "package-test" t))) |
| 367 | (unwind-protect | ||
| 368 | (let ((process-environment | ||
| 369 | (cons (format "HOME=%s" homedir) | ||
| 370 | process-environment))) | ||
| 365 | (epg-check-configuration (epg-configuration)) | 371 | (epg-check-configuration (epg-configuration)) |
| 366 | :passed) | 372 | t) |
| 367 | (error :failed)) | 373 | (delete-directory homedir t))))) |
| 368 | (let* ((keyring (expand-file-name "key.pub" package-test-data-dir)) | 374 | (let* ((keyring (expand-file-name "key.pub" package-test-data-dir)) |
| 369 | (package-test-data-dir | 375 | (package-test-data-dir |
| 370 | (expand-file-name "data/package/signed" package-test-file-dir))) | 376 | (expand-file-name "data/package/signed" package-test-file-dir))) |