aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2018-07-16 07:10:14 -0400
committerNoam Postavsky2018-07-16 07:12:07 -0400
commit46d7c786324f98e73b7615fbc9515ce9a14fa5d4 (patch)
treec70b99d869964613b0fab120f509de2f2025fc71
parent4318d70677dedea12a3dcfb689bce71e409212f0 (diff)
downloademacs-46d7c786324f98e73b7615fbc9515ce9a14fa5d4.tar.gz
emacs-46d7c786324f98e73b7615fbc9515ce9a14fa5d4.zip
; Remove tracing for epg-tests (Bug#23561)
-rw-r--r--lisp/epg-config.el5
-rw-r--r--test/Makefile.in1
-rw-r--r--test/lisp/epg-tests.el37
3 files changed, 7 insertions, 36 deletions
diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index 39d264c05ad..fb866df3920 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -174,13 +174,10 @@ version requirement is met."
174(defun epg-config--make-gpg-configuration (program) 174(defun epg-config--make-gpg-configuration (program)
175 (let (config groups type args) 175 (let (config groups type args)
176 (with-temp-buffer 176 (with-temp-buffer
177 (apply #'call-process program nil 177 (apply #'call-process program nil (list t nil) nil
178 (list t (and (boundp 'trace-level) (> trace-level 0))) nil
179 (append (if epg-gpg-home-directory 178 (append (if epg-gpg-home-directory
180 (list "--homedir" epg-gpg-home-directory)) 179 (list "--homedir" epg-gpg-home-directory))
181 '("--with-colons" "--list-config"))) 180 '("--with-colons" "--list-config")))
182 (when (and (boundp 'trace-level) (> trace-level 0))
183 (trace-values (concat "gpg output:\n" (buffer-string))))
184 (goto-char (point-min)) 181 (goto-char (point-min))
185 (while (re-search-forward "^cfg:\\([^:]+\\):\\(.*\\)" nil t) 182 (while (re-search-forward "^cfg:\\([^:]+\\):\\(.*\\)" nil t)
186 (setq type (intern (match-string 1)) 183 (setq type (intern (match-string 1))
diff --git a/test/Makefile.in b/test/Makefile.in
index 6070932508d..0bc893bc0c6 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -169,7 +169,6 @@ WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
169ifdef EMACS_HYDRA_CI 169ifdef EMACS_HYDRA_CI
170## On Hydra, always show logs for certain problematic tests. 170## On Hydra, always show logs for certain problematic tests.
171lisp/net/tramp-tests.log \ 171lisp/net/tramp-tests.log \
172lisp/epg-tests.log \
173: WRITE_LOG = 2>&1 | tee $@ 172: WRITE_LOG = 2>&1 | tee $@
174endif 173endif
175 174
diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el
index a72a917fe9d..c1e98a6935e 100644
--- a/test/lisp/epg-tests.el
+++ b/test/lisp/epg-tests.el
@@ -23,7 +23,6 @@
23 23
24(require 'ert) 24(require 'ert)
25(require 'epg) 25(require 'epg)
26(require 'trace)
27 26
28(defvar epg-tests-context nil) 27(defvar epg-tests-context nil)
29 28
@@ -42,34 +41,17 @@
42 "2.0") 41 "2.0")
43 prog-alist)) 42 prog-alist))
44 43
45(defvar epg-tests--trace nil)
46
47(defun epg-tests-find-usable-gpg-configuration 44(defun epg-tests-find-usable-gpg-configuration
48 (&optional require-passphrase require-public-key) 45 (&optional require-passphrase require-public-key)
49 ;; Clear config cache because we may be using a different 46 ;; Clear config cache because we may be using a different
50 ;; program-alist. We do want to update the cache, so that 47 ;; program-alist. We do want to update the cache, so that
51 ;; `epg-make-context' can use our result. 48 ;; `epg-make-context' can use our result.
52 (setq epg--configurations nil) 49 (setq epg--configurations nil)
53 ;; Tracing for Bug#23561, but only do it once per run. 50 (epg-find-configuration 'OpenPGP nil
54 (when epg-tests--trace 51 ;; The symmetric operations fail on Hydra
55 (dolist (fun '(epg-find-configuration 52 ;; with gpg 2.0.
56 executable-find 53 (if (or (not require-passphrase) require-public-key)
57 epg-check-configuration 54 epg-tests--config-program-alist)))
58 epg-config--make-gpg-configuration))
59 (trace-function-background fun))
60 (setq epg-tests--trace nil))
61 (prog1 (unwind-protect
62 (epg-find-configuration
63 'OpenPGP nil
64 ;; The symmetric operations fail on Hydra
65 ;; with gpg 2.0.
66 (if (or (not require-passphrase) require-public-key)
67 epg-tests--config-program-alist))
68 (untrace-all))
69 (when (get-buffer "*trace-output*")
70 (princ (with-current-buffer "*trace-output*" (prog1 (buffer-string)
71 (erase-buffer)))
72 #'external-debugging-output))))
73 55
74(defun epg-tests-passphrase-callback (_c _k _d) 56(defun epg-tests-passphrase-callback (_c _k _d)
75 ;; Need to create a copy here, since the string will be wiped out 57 ;; Need to create a copy here, since the string will be wiped out
@@ -82,8 +64,7 @@
82 &rest body) 64 &rest body)
83 "Set up temporary locations and variables for testing." 65 "Set up temporary locations and variables for testing."
84 (declare (indent 1) (debug (sexp body))) 66 (declare (indent 1) (debug (sexp body)))
85 `(let* ((epg-debug epg-tests--trace) 67 `(let* ((epg-tests-home-directory (make-temp-file "epg-tests-homedir" t))
86 (epg-tests-home-directory (make-temp-file "epg-tests-homedir" t))
87 (process-environment 68 (process-environment
88 (append 69 (append
89 (list "GPG_AGENT_INFO" 70 (list "GPG_AGENT_INFO"
@@ -122,15 +103,10 @@
122 (make-local-variable 'epg-tests-context) 103 (make-local-variable 'epg-tests-context)
123 (setq epg-tests-context context) 104 (setq epg-tests-context context)
124 ,@body)) 105 ,@body))
125 (when epg-debug-buffer
126 (princ (with-current-buffer epg-debug-buffer
127 (prog1 (buffer-string) (erase-buffer)))
128 #'external-debugging-output))
129 (when (file-directory-p epg-tests-home-directory) 106 (when (file-directory-p epg-tests-home-directory)
130 (delete-directory epg-tests-home-directory t))))) 107 (delete-directory epg-tests-home-directory t)))))
131 108
132(ert-deftest epg-decrypt-1 () 109(ert-deftest epg-decrypt-1 ()
133 (setq epg-tests--trace t)
134 (with-epg-tests (:require-passphrase t) 110 (with-epg-tests (:require-passphrase t)
135 (should (equal "test" 111 (should (equal "test"
136 (epg-decrypt-string epg-tests-context "\ 112 (epg-decrypt-string epg-tests-context "\
@@ -142,7 +118,6 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA==
142-----END PGP MESSAGE-----"))))) 118-----END PGP MESSAGE-----")))))
143 119
144(ert-deftest epg-roundtrip-1 () 120(ert-deftest epg-roundtrip-1 ()
145 (setq epg-tests--trace t)
146 (with-epg-tests (:require-passphrase t) 121 (with-epg-tests (:require-passphrase t)
147 (let ((cipher (epg-encrypt-string epg-tests-context "symmetric" nil))) 122 (let ((cipher (epg-encrypt-string epg-tests-context "symmetric" nil)))
148 (should (equal "symmetric" 123 (should (equal "symmetric"