]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge package-x-test.el into package-test.el, to avoid running tests twice
authorGlenn Morris <rgm@gnu.org>
Sat, 4 Oct 2014 19:04:36 +0000 (12:04 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 4 Oct 2014 19:04:36 +0000 (12:04 -0700)
* test/automated/package-x-test.el: Remove file...
* test/automated/package-test.el: ... merge package-x-test.el.

Fixes: debbugs:18574
test/ChangeLog
test/automated/package-test.el
test/automated/package-x-test.el [deleted file]

index fb3bd746a73d0d0509eaddb4dd04f19bb38bcf8c..57615c486fcc05631dbfe592a406de34decaf803 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-04  Glenn Morris  <rgm@gnu.org>
+
+       * automated/package-x-test.el: Remove file...
+       * automated/package-test.el: ... merge package-x-test.el.  (Bug#18574)
+
 2014-10-02  Glenn Morris  <rgm@gnu.org>
 
        * automated/package-test.el (with-package-test, package-test-signed):
index a0c1359b13288ad67ad92e6ca274c824534a39f5..6e7994a5a81f23085db7463664fcd7d6e4e7cbda 100644 (file)
@@ -396,6 +396,73 @@ Must called from within a `tar-mode' buffer."
                        (expand-file-name "signed-good-1.0" package-user-dir))
                nil t))))))
 
+
+\f
+;;; Tests for package-x features.
+
+(require 'package-x)
+
+(defvar package-x-test--single-archive-entry-1-3
+  (cons 'simple-single
+        (package-make-ac-desc '(1 3) nil
+                              "A single-file package with no dependencies"
+                              'single
+                              '((:url . "http://doodles.au"))))
+  "Expected contents of the archive entry from the \"simple-single\" package.")
+
+(defvar package-x-test--single-archive-entry-1-4
+  (cons 'simple-single
+        (package-make-ac-desc '(1 4) nil
+                              "A single-file package with no dependencies"
+                              'single
+                              nil))
+  "Expected contents of the archive entry from the updated \"simple-single\" package.")
+
+(ert-deftest package-x-test-upload-buffer ()
+  "Test creating an \"archive-contents\" file"
+  (with-package-test (:basedir "data/package"
+                               :file "simple-single-1.3.el"
+                               :upload-base t)
+    (package-upload-buffer)
+    (should (file-exists-p (expand-file-name "archive-contents"
+                                             package-archive-upload-base)))
+    (should (file-exists-p (expand-file-name "simple-single-1.3.el"
+                                             package-archive-upload-base)))
+    (should (file-exists-p (expand-file-name "simple-single-readme.txt"
+                                             package-archive-upload-base)))
+
+    (let (archive-contents)
+      (with-temp-buffer
+        (insert-file-contents
+         (expand-file-name "archive-contents"
+                           package-archive-upload-base))
+        (setq archive-contents
+              (package-read-from-string
+               (buffer-substring (point-min) (point-max)))))
+      (should (equal archive-contents
+                     (list 1 package-x-test--single-archive-entry-1-3))))))
+
+(ert-deftest package-x-test-upload-new-version ()
+  "Test uploading a new version of a package"
+  (with-package-test (:basedir "data/package"
+                               :file "simple-single-1.3.el"
+                               :upload-base t)
+    (package-upload-buffer)
+    (with-temp-buffer
+      (insert-file-contents "newer-versions/simple-single-1.4.el")
+      (package-upload-buffer))
+
+    (let (archive-contents)
+      (with-temp-buffer
+        (insert-file-contents
+         (expand-file-name "archive-contents"
+                           package-archive-upload-base))
+        (setq archive-contents
+              (package-read-from-string
+               (buffer-substring (point-min) (point-max)))))
+      (should (equal archive-contents
+                     (list 1 package-x-test--single-archive-entry-1-4))))))
+
 (provide 'package-test)
 
 ;;; package-test.el ends here
diff --git a/test/automated/package-x-test.el b/test/automated/package-x-test.el
deleted file mode 100644 (file)
index d58915e..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-;;; package-test.el --- Tests for the Emacs package system
-
-;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
-
-;; Author: Daniel Hackney <dan@haxney.org>
-;; Version: 1.0
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; Code:
-
-(require 'package-x)
-(require 'ert)
-(require 'cl-lib)
-(require 'package-test)
-
-(defvar package-x-test--single-archive-entry-1-3
-  (cons 'simple-single
-        (package-make-ac-desc '(1 3) nil
-                              "A single-file package with no dependencies"
-                              'single
-                              '((:url . "http://doodles.au"))))
-  "Expected contents of the archive entry from the \"simple-single\" package.")
-
-(defvar package-x-test--single-archive-entry-1-4
-  (cons 'simple-single
-        (package-make-ac-desc '(1 4) nil
-                              "A single-file package with no dependencies"
-                              'single
-                              nil))
-  "Expected contents of the archive entry from the updated \"simple-single\" package.")
-
-(ert-deftest package-x-test-upload-buffer ()
-  "Test creating an \"archive-contents\" file"
-  (with-package-test (:basedir "data/package"
-                               :file "simple-single-1.3.el"
-                               :upload-base t)
-    (package-upload-buffer)
-    (should (file-exists-p (expand-file-name "archive-contents"
-                                             package-archive-upload-base)))
-    (should (file-exists-p (expand-file-name "simple-single-1.3.el"
-                                             package-archive-upload-base)))
-    (should (file-exists-p (expand-file-name "simple-single-readme.txt"
-                                             package-archive-upload-base)))
-
-    (let (archive-contents)
-      (with-temp-buffer
-        (insert-file-contents
-         (expand-file-name "archive-contents"
-                           package-archive-upload-base))
-        (setq archive-contents
-              (package-read-from-string
-               (buffer-substring (point-min) (point-max)))))
-      (should (equal archive-contents
-                     (list 1 package-x-test--single-archive-entry-1-3))))))
-
-(ert-deftest package-x-test-upload-new-version ()
-  "Test uploading a new version of a package"
-  (with-package-test (:basedir "data/package"
-                               :file "simple-single-1.3.el"
-                               :upload-base t)
-    (package-upload-buffer)
-    (with-temp-buffer
-      (insert-file-contents "newer-versions/simple-single-1.4.el")
-      (package-upload-buffer))
-
-    (let (archive-contents)
-      (with-temp-buffer
-        (insert-file-contents
-         (expand-file-name "archive-contents"
-                           package-archive-upload-base))
-        (setq archive-contents
-              (package-read-from-string
-               (buffer-substring (point-min) (point-max)))))
-      (should (equal archive-contents
-                     (list 1 package-x-test--single-archive-entry-1-4))))))
-
-(provide 'package-x-test)
-
-;;; package-x-test.el ends here