[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))
- [elpa] elpa-admin 4fdec5b 230/357: packages/yasnippet: subtree pull from external, (continued)
- [elpa] elpa-admin 4fdec5b 230/357: packages/yasnippet: subtree pull from external, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 62629ab 224/357: Merge commit 'd827bb511203a64da3ae5cc6910b87b7c99d233b', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 0a995ba 296/357: * admin/archive-contents.el (archive--insert-repolinks): Fix further, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin aa346f0 290/357: * GNUmakefile (org-fetch): Use https and stick to wget, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin d58576c 301/357: * GNUmakefile (FILTER-nonsrc): Don't compile .dir-locals.el files., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 059dde5 344/357: * GNUmakefile (RULE-singlepkg): Add rules to install&compile each package, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin d5c6272 339/357: * admin/archive-contents.el: foo.tar.sig is not an old tarball, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 221c427 350/357: * admin/archive-contents.el: Improve handling of snapshot version numbers, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 040972d 342/357: * README.org: Describe how to build the archive and add a package, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 1ddc741 347/357: * README.org: Prefer org syntax and prepare for export., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 8ac87bb 355/357: Fold ert-support.el into elpa-admin.el,
Stefan Monnier <=
- [elpa] elpa-admin d8ee815 005/357: # Updated stuff., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin d6dfeed 050/357: Fix last change., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 8787a52 110/357: more documentation and examples, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 524fc02 114/357: updating notes and README text, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 5f38238 131/357: Merge branch 'master' of https://github.com/leoliu/easy-kill, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 3cd0561 181/357: Improve README.md and add a screenshot, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 4a2ebd4 186/357: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin cb8a04b 195/357: * admin/archive-contents.el: Improve docstrings, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin b9f2b90 208/357: * admin/archive-contents.el (archive--sync-emacs-repo): Fix thinko., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 83d4032 202/357: * README: Typos, Stefan Monnier, 2020/12/10