From 449045b2a6e7daae61d24f43e131671c17b56f84 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Mon, 26 Apr 2021 20:01:50 +0200 Subject: [PATCH] Make use of `ert-resource-file' `ert-resource-directory' in comp-tests * test/src/comp-resources/comp-test-pure.el: Rename. * test/src/comp-resources/comp-test-funcs.el: Likewise. * test/src/comp-resources/comp-test-funcs-dyn.el: Likewise. * test/src/comp-resources/comp-test-45603.el: Likewise. * test/src/comp-tests.el (comp-test-src, comp-test-dyn-src): Use `ert-resource-file'. (comp-tests-bootstrap): Use ert-resource-directory. (comp-tests-45603-1, comp-tests-pure): Use `ert-resource-file'. --- .../comp-test-45603.el | 0 .../comp-test-funcs-dyn.el | 0 .../comp-test-funcs.el | 0 .../comp-test-pure.el | 0 test/src/comp-tests.el | 20 ++++++------------- 5 files changed, 6 insertions(+), 14 deletions(-) rename test/src/{comp-tests-resources => comp-resources}/comp-test-45603.el (100%) rename test/src/{comp-tests-resources => comp-resources}/comp-test-funcs-dyn.el (100%) rename test/src/{comp-tests-resources => comp-resources}/comp-test-funcs.el (100%) rename test/src/{comp-tests-resources => comp-resources}/comp-test-pure.el (100%) diff --git a/test/src/comp-tests-resources/comp-test-45603.el b/test/src/comp-resources/comp-test-45603.el similarity index 100% rename from test/src/comp-tests-resources/comp-test-45603.el rename to test/src/comp-resources/comp-test-45603.el diff --git a/test/src/comp-tests-resources/comp-test-funcs-dyn.el b/test/src/comp-resources/comp-test-funcs-dyn.el similarity index 100% rename from test/src/comp-tests-resources/comp-test-funcs-dyn.el rename to test/src/comp-resources/comp-test-funcs-dyn.el diff --git a/test/src/comp-tests-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el similarity index 100% rename from test/src/comp-tests-resources/comp-test-funcs.el rename to test/src/comp-resources/comp-test-funcs.el diff --git a/test/src/comp-tests-resources/comp-test-pure.el b/test/src/comp-resources/comp-test-pure.el similarity index 100% rename from test/src/comp-tests-resources/comp-test-pure.el rename to test/src/comp-resources/comp-test-pure.el diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 8ec32fb041a..a1893fde5c0 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -26,18 +26,12 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'cl-lib) -(defconst comp-test-directory (concat (file-name-directory - (or load-file-name - buffer-file-name)) - "comp-tests-resources/")) +(defconst comp-test-src (ert-resource-file "comp-test-funcs.el")) -(defconst comp-test-src - (expand-file-name "comp-test-funcs.el" comp-test-directory)) - -(defconst comp-test-dyn-src - (expand-file-name"comp-test-funcs-dyn.el" comp-test-directory)) +(defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el")) (when (featurep 'nativecomp) (require 'comp) @@ -61,7 +55,7 @@ Check that the resulting binaries do not differ." :tags '(:expensive-test :nativecomp) (let* ((byte-native-for-bootstrap t) ; FIXME HACK (comp-src (expand-file-name "../../../lisp/emacs-lisp/comp.el" - comp-test-directory)) + (ert-resource-directory))) (comp1-src (make-temp-file "stage1-" nil ".el")) (comp2-src (make-temp-file "stage2-" nil ".el")) ;; Can't use debug symbols. @@ -497,8 +491,7 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." (comp-deftest 45603-1 () "" - (load (native-compile (expand-file-name "comp-test-45603.el" - comp-test-directory))) + (load (native-compile (ert-resource-file "comp-test-45603.el"))) (should (fboundp #'comp-test-45603--file-local-name))) (comp-deftest 46670-1 () @@ -1409,8 +1402,7 @@ Return a list of results." (let ((comp-speed 3) (comp-post-pass-hooks '((comp-final comp-tests-pure-checker-1 comp-tests-pure-checker-2)))) - (load (native-compile (expand-file-name "comp-test-pure.el" - comp-test-directory))) + (load (native-compile (ert-resource-file "comp-test-pure.el"))) (should (subr-native-elisp-p (symbol-function #'comp-tests-pure-caller-f))) (should (= (comp-tests-pure-caller-f) 4)) -- 2.39.5