emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] elpa-admin 8ac87bb 355/357: Fold ert-support.el into elpa-admin.e


From: Stefan Monnier
Subject: [elpa] elpa-admin 8ac87bb 355/357: Fold ert-support.el into elpa-admin.el
Date: Thu, 10 Dec 2020 18:07:14 -0500 (EST)

branch: elpa-admin
commit 8ac87bbf0f7385e603a3fa5199184d409c768830
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Fold ert-support.el into elpa-admin.el
---
 GNUmakefile    |  6 +++---
 elpa-admin.el  | 42 ++++++++++++++++++++++++++++++++++++++++++
 ert-support.el | 55 -------------------------------------------------------
 3 files changed, 45 insertions(+), 58 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 54f4bd7..7474c71 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -267,9 +267,9 @@ TOP =$(shell pwd)
 
 define test_template
 $(1)-test:
-       cd packages/$(1);\
-       $(EMACS) -l $(TOP)/admin/ert-support.el \
-               --eval "(ert-support-test-package \"$(TOP)\" '$(1))" \
+       cd packages/$(1);                                          \
+       $(EMACS) -l $(TOP)/admin/elpa-admin.el                     \
+               --eval "(elpaa-ert-test-package \"$(TOP)\" '$(1))" \
 
 $(1)-test-log:
        $(MAKE) $(1)-test > packages/$(1)/$(1).log 2>&1 || { stat=ERROR; }
diff --git a/elpa-admin.el b/elpa-admin.el
index 49884e5..817340c 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1261,5 +1261,47 @@ If WITH-CORE is non-nil, it means we manage :core 
packages as well."
 (defun elpaa-batch-fetch-and-push (&rest _)
   (elpaa--batch-fetch-and #'elpaa--push))
 
+;;; ERT test support
+
+(defun elpaa-ert-package-install (top-directory package)
+  ;; blitz default value and set up from elpa.
+  (setq package-archives
+        `(("local-elpa"
+          . ,(expand-file-name "archive/packages" top-directory)))
+       package-user-dir (make-temp-file "elpa-test" t))
+  (package-initialize)
+  (package-refresh-contents)
+  (package-install package))
+
+(defun elpaa-ert-test-find-tests (package-directory package)
+  (append
+   `(,(expand-file-name
+       (concat (symbol-name package) "-autoloads.el") package-directory))
+   (or
+    (directory-files package-directory t ".*-test.el$")
+    (directory-files package-directory t ".*-tests.el$")
+    (let ((dir-test (expand-file-name "test" package-directory)))
+      (when (file-directory-p dir-test)
+       (directory-files dir-test t directory-files-no-dot-files-regexp)))
+    (let ((dir-tests (expand-file-name "tests" package-directory)))
+      (when (file-directory-p dir-tests)
+       (directory-files dir-tests t directory-files-no-dot-files-regexp))))))
+
+(defun elpaa-ert-load-tests (package-directory package)
+  (mapc
+   (lambda (file)
+     (let ((force-load-messages t))
+       (load-file file)))
+   (elpaa-ert-test-find-tests package-directory package)))
+
+(defun elpaa-ert-test-package (top-directory package)
+  (elpaa-ert-package-install top-directory package)
+  (elpaa-ert-load-tests
+   (expand-file-name (concat "packages/" (symbol-name package)) top-directory)
+   package)
+
+  (ert-run-tests-batch-and-exit t))
+
+
 (provide 'elpa-admin)
 ;;; elpa-admin.el ends here
diff --git a/ert-support.el b/ert-support.el
deleted file mode 100644
index a0ff9ab..0000000
--- a/ert-support.el
+++ /dev/null
@@ -1,55 +0,0 @@
-;; The contents of this file are subject to the GPL License, Version 3.0.
-
-;; Copyright (C) 2016-2017, Free Software Foundation, Inc.
-
-;; This program is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-(defun ert-support-package-install (top-directory package)
-  ;; blitz default value and set up from elpa.
-  (setq package-archives
-        `(("local-elpa"
-          . ,(expand-file-name "archive/packages" top-directory)))
-       package-user-dir (make-temp-file "elpa-test" t))
-  (package-initialize)
-  (package-refresh-contents)
-  (package-install package))
-
-(defun ert-support-test-find-tests (package-directory package)
-  (append
-   `(,(expand-file-name
-       (concat (symbol-name package) "-autoloads.el") package-directory))
-   (or
-    (directory-files package-directory t ".*-test.el$")
-    (directory-files package-directory t ".*-tests.el$")
-    (let ((dir-test (expand-file-name "test" package-directory)))
-      (when (file-directory-p dir-test)
-       (directory-files dir-test t directory-files-no-dot-files-regexp)))
-    (let ((dir-tests (expand-file-name "tests" package-directory)))
-      (when (file-directory-p dir-tests)
-       (directory-files dir-tests t directory-files-no-dot-files-regexp))))))
-
-(defun ert-support-load-tests (package-directory package)
-  (mapc
-   (lambda (file)
-     (let ((force-load-messages t))
-       (load-file file)))
-   (ert-support-test-find-tests package-directory package)))
-
-(defun ert-support-test-package (top-directory package)
-  (ert-support-package-install top-directory package)
-  (ert-support-load-tests
-   (expand-file-name (concat "packages/" (symbol-name package)) top-directory)
-   package)
-
-  (ert-run-tests-batch-and-exit t))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]