]> git.eshelyaron.com Git - emacs.git/commitdiff
; Remove tracing for epg-tests (Bug#23561)
authorNoam Postavsky <npostavs@gmail.com>
Mon, 16 Jul 2018 11:10:14 +0000 (07:10 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Mon, 16 Jul 2018 11:12:07 +0000 (07:12 -0400)
lisp/epg-config.el
test/Makefile.in
test/lisp/epg-tests.el

index 39d264c05ada317b81c1e84906d42ad7a3dd29fa..fb866df3920b57c3f98e1086ca151fb70cf5e914 100644 (file)
@@ -174,13 +174,10 @@ version requirement is met."
 (defun epg-config--make-gpg-configuration (program)
   (let (config groups type args)
     (with-temp-buffer
-      (apply #'call-process program nil
-             (list t (and (boundp 'trace-level) (> trace-level 0))) nil
+      (apply #'call-process program nil (list t nil) nil
             (append (if epg-gpg-home-directory
                         (list "--homedir" epg-gpg-home-directory))
                     '("--with-colons" "--list-config")))
-      (when (and (boundp 'trace-level) (> trace-level 0))
-        (trace-values (concat "gpg output:\n" (buffer-string))))
       (goto-char (point-min))
       (while (re-search-forward "^cfg:\\([^:]+\\):\\(.*\\)" nil t)
        (setq type (intern (match-string 1))
index 6070932508d47c0165bd080c6885a41b7b32827c..0bc893bc0c69b3f5c9194c734c589096d7db3d62 100644 (file)
@@ -169,7 +169,6 @@ WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
 ifdef EMACS_HYDRA_CI
 ## On Hydra, always show logs for certain problematic tests.
 lisp/net/tramp-tests.log \
-lisp/epg-tests.log \
 : WRITE_LOG = 2>&1 | tee $@
 endif
 
index a72a917fe9deeef3086d90b999100eed5c8ac317..c1e98a6935eddc14b3ff2725dbbb9b5e80bdd8d5 100644 (file)
@@ -23,7 +23,6 @@
 
 (require 'ert)
 (require 'epg)
-(require 'trace)
 
 (defvar epg-tests-context nil)
 
           "2.0")
     prog-alist))
 
-(defvar epg-tests--trace nil)
-
 (defun epg-tests-find-usable-gpg-configuration
     (&optional require-passphrase require-public-key)
   ;; Clear config cache because we may be using a different
   ;; program-alist.  We do want to update the cache, so that
   ;; `epg-make-context' can use our result.
   (setq epg--configurations nil)
-  ;; Tracing for Bug#23561, but only do it once per run.
-  (when epg-tests--trace
-    (dolist (fun '(epg-find-configuration
-                   executable-find
-                   epg-check-configuration
-                   epg-config--make-gpg-configuration))
-      (trace-function-background fun))
-    (setq epg-tests--trace nil))
-  (prog1 (unwind-protect
-             (epg-find-configuration
-              'OpenPGP nil
-              ;; The symmetric operations fail on Hydra
-              ;; with gpg 2.0.
-              (if (or (not require-passphrase) require-public-key)
-                  epg-tests--config-program-alist))
-           (untrace-all))
-    (when (get-buffer "*trace-output*")
-      (princ (with-current-buffer "*trace-output*" (prog1 (buffer-string)
-                                                     (erase-buffer)))
-             #'external-debugging-output))))
+  (epg-find-configuration 'OpenPGP nil
+                          ;; The symmetric operations fail on Hydra
+                          ;; with gpg 2.0.
+                          (if (or (not require-passphrase) require-public-key)
+                              epg-tests--config-program-alist)))
 
 (defun epg-tests-passphrase-callback (_c _k _d)
   ;; Need to create a copy here, since the string will be wiped out
@@ -82,8 +64,7 @@
                            &rest body)
   "Set up temporary locations and variables for testing."
   (declare (indent 1) (debug (sexp body)))
-  `(let* ((epg-debug epg-tests--trace)
-          (epg-tests-home-directory (make-temp-file "epg-tests-homedir" t))
+  `(let* ((epg-tests-home-directory (make-temp-file "epg-tests-homedir" t))
          (process-environment
           (append
            (list "GPG_AGENT_INFO"
             (make-local-variable 'epg-tests-context)
             (setq epg-tests-context context)
             ,@body))
-       (when epg-debug-buffer
-         (princ (with-current-buffer epg-debug-buffer
-                  (prog1 (buffer-string) (erase-buffer)))
-                #'external-debugging-output))
        (when (file-directory-p epg-tests-home-directory)
         (delete-directory epg-tests-home-directory t)))))
 
 (ert-deftest epg-decrypt-1 ()
-  (setq epg-tests--trace t)
   (with-epg-tests (:require-passphrase t)
     (should (equal "test"
                   (epg-decrypt-string epg-tests-context "\
@@ -142,7 +118,6 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA==
 -----END PGP MESSAGE-----")))))
 
 (ert-deftest epg-roundtrip-1 ()
-  (setq epg-tests--trace t)
   (with-epg-tests (:require-passphrase t)
     (let ((cipher (epg-encrypt-string epg-tests-context "symmetric" nil)))
       (should (equal "symmetric"