[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin 8ac87bb 355/439: Fold ert-support.el into elpa-admin
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin 8ac87bb 355/439: Fold ert-support.el into elpa-admin.el |
Date: |
Sun, 17 Oct 2021 15:48:35 -0400 (EDT) |
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))
- [nongnu] elpa-admin da248f5 403/439: * elpa-admin.el: Fix spurious message and unneeded error, (continued)
- [nongnu] elpa-admin da248f5 403/439: * elpa-admin.el: Fix spurious message and unneeded error, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 1d5287f 362/439: * elpa-admin.el: Add support for building Info files and "dir" files, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b3fe7c4 368/439: * elpa-admin.el (elpaa--email-reply-to): New var, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 21fc443 349/439: * externals-list ("markdown-mode"): New package, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin cabb85a 398/439: * elpa-admin.el: Avoid build side-products in the tarball, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 08c448d 400/439: * elpa-admin.el (elpaa--pull): Fix last change, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 21e1b0e 101/439: Sync with yasnippet/master, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 7b7692d 243/439: Merge commit '6dc971269f6f9435e5159c2cfe66fc5e4b296df2', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 858666e 250/439: * admin/archive-contents.el: Use cl-lib, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin f4e99d9 369/439: * elpa-admin.el (elpaa--make-one-package): Fix thinko, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 8ac87bb 355/439: Fold ert-support.el into elpa-admin.el,
Philip Kaludercic <=
- [nongnu] elpa-admin 7fa8f34 399/439: * elpa-admin.el (elpaa--pull): Don't set non-existing upstream, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 78966fe 348/439: * README.org: Improve introductory paragraphs., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 1ddc741 347/439: * README.org: Prefer org syntax and prepare for export., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 0466964 352/439: * README.org (Adding a package): Adjust to use the new `make` targets, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin a74eed7 366/439: * elpa-admin.el (elpaa--bwrap-args): Add `lib64` for amd64 hosts, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 60ecd84 351/439: * admin/archive-contents.el: Fix construction of index.html, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin dcc3222 396/439: Fix various problems when compiling packages in place, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d1d1dbd 393/439: * elpa-admin.el (elpaa--build-Info): Fix last change, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 0942ea5 385/439: ; * README.org: Fix typos., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 21cddee 407/439: * elpa-admin.el (elpaa--get-devel-version): Fix regexp substitution, Philip Kaludercic, 2021/10/17