diff options
| author | Noam Postavsky | 2017-07-16 19:12:10 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-08-07 18:43:55 -0400 |
| commit | 95a04fd26c91e6c6c9191a629d26886f136e30fc (patch) | |
| tree | 2ac918b82a0b22d7719cae4f63cd1e2bf2d0e7e2 | |
| parent | 054c198c120c1f01a8ff753892d52710b740acc6 (diff) | |
| download | emacs-95a04fd26c91e6c6c9191a629d26886f136e30fc.tar.gz emacs-95a04fd26c91e6c6c9191a629d26886f136e30fc.zip | |
; Avoid test failures when running from compiled test files
* test/lisp/dom-tests.el: Require `subr-x' during runtime as well.
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-defstruct-record):
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
(eieio-test-23-inheritance-check, eieio-test-25-slot-tests): Mark as
expected to fail when byte-compiled.
| -rw-r--r-- | test/lisp/dom-tests.el | 5 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/cl-lib-tests.el | 8 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/eieio-tests/eieio-tests.el | 12 |
3 files changed, 24 insertions, 1 deletions
diff --git a/test/lisp/dom-tests.el b/test/lisp/dom-tests.el index 32d231a47e5..24d4b932452 100644 --- a/test/lisp/dom-tests.el +++ b/test/lisp/dom-tests.el | |||
| @@ -26,7 +26,10 @@ | |||
| 26 | 26 | ||
| 27 | (require 'dom) | 27 | (require 'dom) |
| 28 | (require 'ert) | 28 | (require 'ert) |
| 29 | (eval-when-compile (require 'subr-x)) | 29 | |
| 30 | ;; `defsubst's are not inlined inside `ert-deftest' (see Bug#24402), | ||
| 31 | ;; therefore we can't use `eval-when-compile' here. | ||
| 32 | (require 'subr-x) | ||
| 30 | 33 | ||
| 31 | (defun dom-tests--tree () | 34 | (defun dom-tests--tree () |
| 32 | "Return a DOM tree for testing." | 35 | "Return a DOM tree for testing." |
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index 65bd97f3b2d..9e68dceb8f1 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el | |||
| @@ -518,7 +518,15 @@ | |||
| 518 | (ert-deftest cl-lib-symbol-macrolet-2 () | 518 | (ert-deftest cl-lib-symbol-macrolet-2 () |
| 519 | (should (equal (cl-lib-symbol-macrolet-4+5) (+ 4 5)))) | 519 | (should (equal (cl-lib-symbol-macrolet-4+5) (+ 4 5)))) |
| 520 | 520 | ||
| 521 | (defun cl-lib-tests--dummy-function () | ||
| 522 | ;; Dummy function to see if the file is compiled. | ||
| 523 | t) | ||
| 524 | |||
| 521 | (ert-deftest cl-lib-defstruct-record () | 525 | (ert-deftest cl-lib-defstruct-record () |
| 526 | ;; This test fails when compiled, see Bug#24402/27718. | ||
| 527 | :expected-result (if (byte-code-function-p | ||
| 528 | (symbol-function 'cl-lib-tests--dummy-function)) | ||
| 529 | :failed :passed) | ||
| 522 | (cl-defstruct foo x) | 530 | (cl-defstruct foo x) |
| 523 | (let ((x (make-foo :x 42))) | 531 | (let ((x (make-foo :x 42))) |
| 524 | (should (recordp x)) | 532 | (should (recordp x)) |
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el index 1a6ab9da085..d824bfc1bb4 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el | |||
| @@ -529,7 +529,15 @@ METHOD is the method that was attempting to be called." | |||
| 529 | "This class should break.")) | 529 | "This class should break.")) |
| 530 | :type 'invalid-slot-type)) | 530 | :type 'invalid-slot-type)) |
| 531 | 531 | ||
| 532 | (defun eieio-tests--dummy-function () | ||
| 533 | ;; Dummy function to see if the file is compiled. | ||
| 534 | t) | ||
| 535 | |||
| 532 | (ert-deftest eieio-test-23-inheritance-check () | 536 | (ert-deftest eieio-test-23-inheritance-check () |
| 537 | ;; This test fails when compiled, see Bug#27718. | ||
| 538 | :expected-result (if (byte-code-function-p | ||
| 539 | (symbol-function 'eieio-tests--dummy-function)) | ||
| 540 | :failed :passed) | ||
| 533 | (should (child-of-class-p 'class-ab 'class-a)) | 541 | (should (child-of-class-p 'class-ab 'class-a)) |
| 534 | (should (child-of-class-p 'class-ab 'class-b)) | 542 | (should (child-of-class-p 'class-ab 'class-b)) |
| 535 | (should (object-of-class-p eitest-a 'class-a)) | 543 | (should (object-of-class-p eitest-a 'class-a)) |
| @@ -548,6 +556,10 @@ METHOD is the method that was attempting to be called." | |||
| 548 | (should (not (cl-typep "foo" 'class-a)))) | 556 | (should (not (cl-typep "foo" 'class-a)))) |
| 549 | 557 | ||
| 550 | (ert-deftest eieio-test-24-object-predicates () | 558 | (ert-deftest eieio-test-24-object-predicates () |
| 559 | ;; This test fails when compiled, see Bug#27718. | ||
| 560 | :expected-result (if (byte-code-function-p | ||
| 561 | (symbol-function 'eieio-tests--dummy-function)) | ||
| 562 | :failed :passed) | ||
| 551 | (let ((listooa (list (class-ab) (class-a))) | 563 | (let ((listooa (list (class-ab) (class-a))) |
| 552 | (listoob (list (class-ab) (class-b)))) | 564 | (listoob (list (class-ab) (class-b)))) |
| 553 | (should (cl-typep listooa '(list-of class-a))) | 565 | (should (cl-typep listooa '(list-of class-a))) |