[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 8461cfc 3/4: Move epg.el test data to follow our conventions
From: |
Stefan Kangas |
Subject: |
master 8461cfc 3/4: Move epg.el test data to follow our conventions |
Date: |
Fri, 23 Oct 2020 21:41:46 -0400 (EDT) |
branch: master
commit 8461cfc8fcef424c7f1098f967679b4bdaa4348e
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Move epg.el test data to follow our conventions
* test/lisp/epg-tests.el (ert-x): Require.
(epg-tests-data-directory): Remove variable.
(with-epg-tests): Use ert-resource-file.
* test/lisp/epg-resources/*: Moved from test/data/epg/.
---
test/{data/epg => lisp/epg-resources}/dummy-pinentry | 0
test/{data/epg => lisp/epg-resources}/pubkey.asc | 0
test/{data/epg => lisp/epg-resources}/seckey.asc | 0
test/lisp/epg-tests.el | 12 ++++--------
4 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/test/data/epg/dummy-pinentry
b/test/lisp/epg-resources/dummy-pinentry
similarity index 100%
rename from test/data/epg/dummy-pinentry
rename to test/lisp/epg-resources/dummy-pinentry
diff --git a/test/data/epg/pubkey.asc b/test/lisp/epg-resources/pubkey.asc
similarity index 100%
rename from test/data/epg/pubkey.asc
rename to test/lisp/epg-resources/pubkey.asc
diff --git a/test/data/epg/seckey.asc b/test/lisp/epg-resources/seckey.asc
similarity index 100%
rename from test/data/epg/seckey.asc
rename to test/lisp/epg-resources/seckey.asc
diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el
index 2a9c021..c9c92f5 100644
--- a/test/lisp/epg-tests.el
+++ b/test/lisp/epg-tests.el
@@ -22,14 +22,11 @@
;;; Code:
(require 'ert)
+(require 'ert-x)
(require 'epg)
(defvar epg-tests-context nil)
-(defvar epg-tests-data-directory
- (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY"))
- "Directory containing epg test data.")
-
(defconst epg-tests--config-program-alist
;; The default `epg-config--program-alist' requires gpg2 2.1 or
;; greater due to some practical problems with pinentry. But most
@@ -85,8 +82,7 @@
'(with-temp-file (expand-file-name
"gpg-agent.conf" epg-tests-home-directory)
(insert "pinentry-program "
- (expand-file-name "dummy-pinentry"
- epg-tests-data-directory)
+ (ert-resource-file "dummy-pinentry")
"\n")
(epg-context-set-passphrase-callback
context
@@ -94,11 +90,11 @@
,(if require-public-key
'(epg-import-keys-from-file
context
- (expand-file-name "pubkey.asc" epg-tests-data-directory)))
+ (ert-resource-file "pubkey.asc")))
,(if require-secret-key
'(epg-import-keys-from-file
context
- (expand-file-name "seckey.asc" epg-tests-data-directory)))
+ (ert-resource-file "seckey.asc")))
(with-temp-buffer
(make-local-variable 'epg-tests-context)
(setq epg-tests-context context)