mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Move package test files to new directory.
* test/lisp/emacs-lisp/package-tests.el: Update resoruce file location. * test/data/package: Moved to test/lisp/emacs-lisp/package-resources
This commit is contained in:
parent
a546a37fcd
commit
6579e5b6bb
20 changed files with 12 additions and 11 deletions
17
test/lisp/emacs-lisp/package-resources/archive-contents
Normal file
17
test/lisp/emacs-lisp/package-resources/archive-contents
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
(1
|
||||
(simple-single .
|
||||
[(1 3)
|
||||
nil "A single-file package with no dependencies" single
|
||||
((:url . "http://doodles.au")
|
||||
(:keywords quote ("frobnicate")))])
|
||||
(simple-depend .
|
||||
[(1 0)
|
||||
((simple-single (1 3))) "A single-file package with a dependency." single])
|
||||
(simple-two-depend .
|
||||
[(1 1)
|
||||
((simple-depend (1 0)) (simple-single (1 3)))
|
||||
"A single-file package with two dependencies." single])
|
||||
(multi-file .
|
||||
[(0 2 3)
|
||||
nil "Example of a multi-file tar package" tar
|
||||
((:url . "http://puddles.li"))]))
|
||||
18
test/lisp/emacs-lisp/package-resources/key.pub
Normal file
18
test/lisp/emacs-lisp/package-resources/key.pub
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.14 (GNU/Linux)
|
||||
|
||||
mQENBFJNB8gBCACfbtpvYrM8V1HM0KFlIwatcEJugHqwOHpr/Z9mrCW0fxyQAW/d
|
||||
2L+3QVNsN9Tz/K9lLcBUgeR7rhVEzHNqhmhNj/HnikwGqXbIofhp+QbZmBKnAlCz
|
||||
d77kg8K9lozHtfTkm1gX/7DdPzQKmgi7WOzzi2395wGubeqJLvYaEcqVbI0Eob+E
|
||||
3CzRjNy/e/Tf3TJRW5etTcdZN6LVuIY7tNCHqlQZTwyycON/hfLTX6cLCnzDsqm/
|
||||
NxCuwn9aqP9aGRGfIu7Y+If3zTymvrXEPUN98OEID814bOKdx0uVTZRiSMbvuTGI
|
||||
8uMa/kpGX/78rqI61gbZV51RFoU7pT2tzwY/ABEBAAG0HkouIFIuIEhhY2tlciA8
|
||||
anJoQGV4YW1wbGUuY29tPokBOAQTAQIAIgUCUk0HyAIbAwYLCQgHAwIGFQgCCQoL
|
||||
BBYCAwECHgECF4AACgkQtpVAhgkYletuhQf+JAyHYhTZNxjq0UYlikuLX8EtYbXX
|
||||
PB+03J0B73SMzEai5XsiTU2ADxqxwr7pveVK1INf+IGLiiXBlQq+4DSOvQY4xLfp
|
||||
58jTOYRV1ECvlXK/JtvVOwufXREADaydf9l/MUxA5G2PPBWIuQknh3ysPSsx68OJ
|
||||
SzNHFwklLn0DKc4WloE/GLDpTzimnCg7QGzuUo3Iilpjdy8EvTdI5d3jx/mGJIwI
|
||||
goB+YZgyxSPM+GjDwh5DEwD7OexNqqa7RynnmU0epmlYyi9UufCHLwgiiEIzjpWi
|
||||
6+iF+CQ45ZAKncovByenIUv73J3ImOudrsskeAHBmahljv1he6uV9Egj2Q==
|
||||
=b5Kg
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
33
test/lisp/emacs-lisp/package-resources/key.sec
Normal file
33
test/lisp/emacs-lisp/package-resources/key.sec
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||
Version: GnuPG v1.4.14 (GNU/Linux)
|
||||
|
||||
lQO+BFJNB8gBCACfbtpvYrM8V1HM0KFlIwatcEJugHqwOHpr/Z9mrCW0fxyQAW/d
|
||||
2L+3QVNsN9Tz/K9lLcBUgeR7rhVEzHNqhmhNj/HnikwGqXbIofhp+QbZmBKnAlCz
|
||||
d77kg8K9lozHtfTkm1gX/7DdPzQKmgi7WOzzi2395wGubeqJLvYaEcqVbI0Eob+E
|
||||
3CzRjNy/e/Tf3TJRW5etTcdZN6LVuIY7tNCHqlQZTwyycON/hfLTX6cLCnzDsqm/
|
||||
NxCuwn9aqP9aGRGfIu7Y+If3zTymv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bU/4zJ9e2HUOJAZI1r
|
||||
d7QeSi4gUi4gSGFja2VyIDxqcmhAZXhhbXBsZS5jb20+iQE4BBMBAgAiBQJSTQfI
|
||||
AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRC2lUCGCRiV626FB/4kDIdi
|
||||
FNk3GOrRRiWKS4tfwS1htdc8H7TcnQHvdIzMRqLleyJNTYAPGrHCvum95UrUg1/4
|
||||
gYuKJcGVCr7gNI69BjjEt+nnyNM5hFXUQK+Vcr8m29U7C59dEQANrJ1/2X8xTEDk
|
||||
bY88FYi5CSeHfKw9KzHrw4lLM0cXCSUufQMpzhaWgT8YsOlPOKacKDtAbO5SjciK
|
||||
WmN3LwS9N0jl3ePH+YYkjAiCgH5hmDLFI8z4aMPCHkMTAPs57E2qprtHKeeZTR6m
|
||||
aVjKL1S58IcvCCKIQjOOlaLr6IX4JDjlkAqdyi8HJ6chS/vcnciY652uyyR4AcGZ
|
||||
qGWO/WF7q5X0SCPZ
|
||||
=5FZK
|
||||
-----END PGP PRIVATE KEY BLOCK-----
|
||||
BIN
test/lisp/emacs-lisp/package-resources/multi-file-0.2.3.tar
Normal file
BIN
test/lisp/emacs-lisp/package-resources/multi-file-0.2.3.tar
Normal file
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
This is a bare-bones readme file for the multi-file package.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
(1
|
||||
(simple-single .
|
||||
[(1 4)
|
||||
nil "A single-file package with no dependencies" single])
|
||||
(simple-depend .
|
||||
[(1 0)
|
||||
((simple-single (1 3))) "A single-file package with a dependency." single])
|
||||
(new-pkg .
|
||||
[(1 0)
|
||||
nil "A package only seen after "updating" archive-contents" single])
|
||||
(multi-file .
|
||||
[(0 2 3)
|
||||
nil "Example of a multi-file tar package" tar]))
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
;;; new-pkg.el --- A package only seen after "updating" archive-contents
|
||||
|
||||
;; Author: J. R. Hacker <jrh@example.com>
|
||||
;; Version: 1.0
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This will only show up after updating "archive-contents".
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defun new-pkg-frob ()
|
||||
"Ignore me."
|
||||
(ignore))
|
||||
|
||||
(provide 'new-pkg)
|
||||
|
||||
;;; new-pkg.el ends here
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
;;; simple-single.el --- A single-file package with no dependencies
|
||||
|
||||
;; Author: J. R. Hacker <jrh@example.com>
|
||||
;; Version: 1.4
|
||||
;; Keywords: frobnicate
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This package provides a minor mode to frobnicate and/or bifurcate
|
||||
;; any flanges you desire. To activate it, type "C-M-r M-3 butterfly"
|
||||
;; and all your dreams will come true.
|
||||
;;
|
||||
;; This is a new, updated version.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defgroup simple-single nil "Simply a file"
|
||||
:group 'lisp)
|
||||
|
||||
(defcustom simple-single-super-sunday nil
|
||||
"How great is this?
|
||||
Default changed to nil."
|
||||
:type 'boolean
|
||||
:group 'simple-single
|
||||
:package-version "1.4")
|
||||
|
||||
(defvar simple-single-sudo-sandwich nil
|
||||
"Make a sandwich?")
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode simple-single-mode
|
||||
"It does good things to stuff")
|
||||
|
||||
(provide 'simple-single)
|
||||
|
||||
;;; simple-single.el ends here
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import sys
|
||||
import BaseHTTPServer
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
|
||||
|
||||
HandlerClass = SimpleHTTPRequestHandler
|
||||
ServerClass = BaseHTTPServer.HTTPServer
|
||||
Protocol = "HTTP/1.0"
|
||||
|
||||
if sys.argv[1:]:
|
||||
port = int(sys.argv[1])
|
||||
else:
|
||||
port = 8000
|
||||
server_address = ('127.0.0.1', port)
|
||||
|
||||
HandlerClass.protocol_version = Protocol
|
||||
httpd = ServerClass(server_address, HandlerClass)
|
||||
|
||||
sa = httpd.socket.getsockname()
|
||||
print "Serving HTTP on", sa[0], "port", sa[1], "..."
|
||||
httpd.serve_forever()
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(1
|
||||
(signed-good .
|
||||
[(1 0)
|
||||
nil "A package with good signature" single])
|
||||
(signed-bad .
|
||||
[(1 0)
|
||||
nil "A package with bad signature" single]))
|
||||
Binary file not shown.
|
|
@ -0,0 +1,33 @@
|
|||
;;; signed-bad.el --- A single-file package with bad signature
|
||||
|
||||
;; Author: J. R. Hacker <jrh@example.com>
|
||||
;; Version: 1.0
|
||||
;; Keywords: frobnicate
|
||||
;; URL: http://doodles.au
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This package provides a minor mode to frobnicate and/or bifurcate
|
||||
;; any flanges you desire. To activate it, type "C-M-r M-3 butterfly"
|
||||
;; and all your dreams will come true.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defgroup signed-bad nil "Simply a file"
|
||||
:group 'lisp)
|
||||
|
||||
(defcustom signed-bad-super-sunday t
|
||||
"How great is this?"
|
||||
:type 'boolean
|
||||
:group 'signed-bad)
|
||||
|
||||
(defvar signed-bad-sudo-sandwich nil
|
||||
"Make a sandwich?")
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode signed-bad-mode
|
||||
"It does good things to stuff")
|
||||
|
||||
(provide 'signed-bad)
|
||||
|
||||
;;; signed-bad.el ends here
|
||||
Binary file not shown.
|
|
@ -0,0 +1,33 @@
|
|||
;;; signed-good.el --- A single-file package with good signature
|
||||
|
||||
;; Author: J. R. Hacker <jrh@example.com>
|
||||
;; Version: 1.0
|
||||
;; Keywords: frobnicate
|
||||
;; URL: http://doodles.au
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This package provides a minor mode to frobnicate and/or bifurcate
|
||||
;; any flanges you desire. To activate it, type "C-M-r M-3 butterfly"
|
||||
;; and all your dreams will come true.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defgroup signed-good nil "Simply a file"
|
||||
:group 'lisp)
|
||||
|
||||
(defcustom signed-good-super-sunday t
|
||||
"How great is this?"
|
||||
:type 'boolean
|
||||
:group 'signed-good)
|
||||
|
||||
(defvar signed-good-sudo-sandwich nil
|
||||
"Make a sandwich?")
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode signed-good-mode
|
||||
"It does good things to stuff")
|
||||
|
||||
(provide 'signed-good)
|
||||
|
||||
;;; signed-good.el ends here
|
||||
Binary file not shown.
17
test/lisp/emacs-lisp/package-resources/simple-depend-1.0.el
Normal file
17
test/lisp/emacs-lisp/package-resources/simple-depend-1.0.el
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
;;; simple-depend.el --- A single-file package with a dependency.
|
||||
|
||||
;; Author: J. R. Hacker <jrh@example.com>
|
||||
;; Version: 1.0
|
||||
;; Keywords: frobnicate
|
||||
;; Package-Requires: ((simple-single "1.3"))
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Depends on another package.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defvar simple-depend "Value"
|
||||
"Some trivial code")
|
||||
|
||||
;;; simple-depend.el ends here
|
||||
33
test/lisp/emacs-lisp/package-resources/simple-single-1.3.el
Normal file
33
test/lisp/emacs-lisp/package-resources/simple-single-1.3.el
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
;;; simple-single.el --- A single-file package with no dependencies
|
||||
|
||||
;; Author: J. R. Hacker <jrh@example.com>
|
||||
;; Version: 1.3
|
||||
;; Keywords: frobnicate
|
||||
;; URL: http://doodles.au
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This package provides a minor mode to frobnicate and/or bifurcate
|
||||
;; any flanges you desire. To activate it, type "C-M-r M-3 butterfly"
|
||||
;; and all your dreams will come true.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defgroup simple-single nil "Simply a file"
|
||||
:group 'lisp)
|
||||
|
||||
(defcustom simple-single-super-sunday t
|
||||
"How great is this?"
|
||||
:type 'boolean
|
||||
:group 'simple-single)
|
||||
|
||||
(defvar simple-single-sudo-sandwich nil
|
||||
"Make a sandwich?")
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode simple-single-mode
|
||||
"It does good things to stuff")
|
||||
|
||||
(provide 'simple-single)
|
||||
|
||||
;;; simple-single.el ends here
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
This package provides a minor mode to frobnicate and/or bifurcate
|
||||
any flanges you desire. To activate it, type "C-M-r M-3 butterfly"
|
||||
and all your dreams will come true.
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
;;; simple-two-depend.el --- A single-file package with two dependencies.
|
||||
|
||||
;; Author: J. R. Hacker <jrh@example.com>
|
||||
;; Version: 1.1
|
||||
;; Keywords: frobnicate
|
||||
;; Package-Requires: ((simple-depend "1.0") (simple-single "1.3"))
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Depends on two another packages.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defvar simple-two-depend "Value"
|
||||
"Some trivial code")
|
||||
|
||||
;;; simple-two-depend.el ends here
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
(multi-file (0 1))))
|
||||
"`package-desc' used for testing dependencies.")
|
||||
|
||||
(defvar package-test-data-dir (expand-file-name "data/package" package-test-file-dir)
|
||||
(defvar package-test-data-dir (expand-file-name "package-resources" package-test-file-dir)
|
||||
"Base directory of package test files.")
|
||||
|
||||
(defvar package-test-fake-contents-file
|
||||
|
|
@ -190,18 +190,18 @@ Must called from within a `tar-mode' buffer."
|
|||
|
||||
(ert-deftest package-test-desc-from-buffer ()
|
||||
"Parse an elisp buffer to get a `package-desc' object."
|
||||
(with-package-test (:basedir "data/package" :file "simple-single-1.3.el")
|
||||
(with-package-test (:basedir "package-resources" :file "simple-single-1.3.el")
|
||||
(should (equal (package-buffer-info) simple-single-desc)))
|
||||
(with-package-test (:basedir "data/package" :file "simple-depend-1.0.el")
|
||||
(with-package-test (:basedir "package-resources" :file "simple-depend-1.0.el")
|
||||
(should (equal (package-buffer-info) simple-depend-desc)))
|
||||
(with-package-test (:basedir "data/package"
|
||||
(with-package-test (:basedir "package-resources"
|
||||
:file "multi-file-0.2.3.tar")
|
||||
(tar-mode)
|
||||
(should (equal (package-tar-file-info) multi-file-desc))))
|
||||
|
||||
(ert-deftest package-test-install-single ()
|
||||
"Install a single file without using an archive."
|
||||
(with-package-test (:basedir "data/package" :file "simple-single-1.3.el")
|
||||
(with-package-test (:basedir "package-resources" :file "simple-single-1.3.el")
|
||||
(should (package-install-from-buffer))
|
||||
(package-initialize)
|
||||
(should (package-installed-p 'simple-single))
|
||||
|
|
@ -269,7 +269,7 @@ Must called from within a `tar-mode' buffer."
|
|||
(ert-deftest package-test-install-prioritized ()
|
||||
"Install a lower version from a higher-prioritized archive."
|
||||
(with-package-test ()
|
||||
(let* ((newer-version (expand-file-name "data/package/newer-versions"
|
||||
(let* ((newer-version (expand-file-name "package-resources/newer-versions"
|
||||
package-test-file-dir))
|
||||
(package-archives `(("older" . ,package-test-data-dir)
|
||||
("newer" . ,newer-version)))
|
||||
|
|
@ -285,7 +285,7 @@ Must called from within a `tar-mode' buffer."
|
|||
|
||||
(ert-deftest package-test-install-multifile ()
|
||||
"Check properties of the installed multi-file package."
|
||||
(with-package-test (:basedir "data/package" :install '(multi-file))
|
||||
(with-package-test (:basedir "package-resources" :install '(multi-file))
|
||||
(let ((autoload-file
|
||||
(expand-file-name "multi-file-autoloads.el"
|
||||
(expand-file-name
|
||||
|
|
@ -336,7 +336,7 @@ Must called from within a `tar-mode' buffer."
|
|||
(package-menu-execute)
|
||||
(should (package-installed-p 'simple-single))
|
||||
(let ((package-test-data-dir
|
||||
(expand-file-name "data/package/newer-versions" package-test-file-dir)))
|
||||
(expand-file-name "package-resources/newer-versions" package-test-file-dir)))
|
||||
(setq package-archives `(("gnu" . ,package-test-data-dir)))
|
||||
(package-menu-refresh)
|
||||
|
||||
|
|
@ -456,7 +456,7 @@ Must called from within a `tar-mode' buffer."
|
|||
(delete-directory homedir t)))))
|
||||
(let* ((keyring (expand-file-name "key.pub" package-test-data-dir))
|
||||
(package-test-data-dir
|
||||
(expand-file-name "data/package/signed" package-test-file-dir)))
|
||||
(expand-file-name "package-resources/signed" package-test-file-dir)))
|
||||
(with-package-test ()
|
||||
(package-initialize)
|
||||
(package-import-keyring keyring)
|
||||
|
|
@ -508,7 +508,7 @@ Must called from within a `tar-mode' buffer."
|
|||
|
||||
(ert-deftest package-x-test-upload-buffer ()
|
||||
"Test creating an \"archive-contents\" file"
|
||||
(with-package-test (:basedir "data/package"
|
||||
(with-package-test (:basedir "package-resources"
|
||||
:file "simple-single-1.3.el"
|
||||
:upload-base t)
|
||||
(package-upload-buffer)
|
||||
|
|
@ -532,7 +532,7 @@ Must called from within a `tar-mode' buffer."
|
|||
|
||||
(ert-deftest package-x-test-upload-new-version ()
|
||||
"Test uploading a new version of a package"
|
||||
(with-package-test (:basedir "data/package"
|
||||
(with-package-test (:basedir "package-resources"
|
||||
:file "simple-single-1.3.el"
|
||||
:upload-base t)
|
||||
(package-upload-buffer)
|
||||
|
|
@ -599,6 +599,7 @@ Must called from within a `tar-mode' buffer."
|
|||
simple-depend-desc-2)))
|
||||
(should
|
||||
(equal (package--sort-by-dependence delete-list)
|
||||
|
||||
(list simple-depend-desc-2 simple-depend-desc-1 new-pkg-desc
|
||||
multi-file-desc simple-depend-desc simple-single-desc)))
|
||||
(should
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue