summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/eieio-tests
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2017-11-30 20:51:07 -0500
committerNoam Postavsky <npostavs@gmail.com>2017-12-03 15:39:02 -0500
commitcfa50d30f2876ca30158082e9a91d19e804a7e09 (patch)
treeabca833b43f9194d6fa0c8fb0410db91da768d7f /test/lisp/emacs-lisp/eieio-tests
parent6e0008890ffcfdcd0a8fc827c7108907bfb25d0a (diff)
downloademacs-cfa50d30f2876ca30158082e9a91d19e804a7e09.tar.gz
; Tracing for eieio-test random failure (Bug#24503)
* test/Makefile.in [EMACS_HYDRA_CI]: Always show log for eieio-tests. * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (top-level): Trace cl-generic functions. (eieio-test-dump-trace): New function. (eieio-test-37-obsolete-name-in-constructor): Use it.
Diffstat (limited to 'test/lisp/emacs-lisp/eieio-tests')
-rw-r--r--test/lisp/emacs-lisp/eieio-tests/eieio-tests.el22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
index fbdb9896a40..454f2aaca0e 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
@@ -887,15 +887,33 @@ Subclasses to override slot attributes.")
(should (= (length (eieio-build-class-alist 'opt-test1 nil)) 2))
(should (= (length (eieio-build-class-alist 'opt-test1 t)) 1)))
+(mapatoms (lambda (a)
+ (when (and (fboundp a)
+ (string-match "\\`cl--?generic"
+ (symbol-name a)))
+ (trace-function-background a))))
+
(defclass eieio--testing () ())
(defmethod constructor :static ((_x eieio--testing) newname &rest _args)
(list newname 2))
+(defun eieio-test-dump-trace ()
+ (message "%s" (with-current-buffer "*trace-output*"
+ (goto-char (point-min))
+ (while (re-search-forward "[\0-\010\013-\037]" nil t)
+ (insert (prog1 (format "\\%03o" (char-before))
+ (delete-char -1))))
+ (buffer-string))))
+(eieio-test-dump-trace)
+
(ert-deftest eieio-test-37-obsolete-name-in-constructor ()
;; FIXME repeated intermittent failures on hydra (bug#24503)
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
- (should (equal (eieio--testing "toto") '("toto" 2))))
+ (with-current-buffer "*trace-output*"
+ (erase-buffer))
+ (unwind-protect
+ (should (equal (eieio--testing "toto") '("toto" 2)))
+ (eieio-test-dump-trace)))
(ert-deftest eieio-autoload ()
"Tests to see whether reftex-auc has been autoloaded"