* test-env.el: Removed (Separated to check-*.el).
authorteranisi <teranisi>
Thu, 30 Aug 2001 00:59:23 +0000 (00:59 +0000)
committerteranisi <teranisi>
Thu, 30 Aug 2001 00:59:23 +0000 (00:59 +0000)
* check-base64.el: New file.

* check-modules.el: Ditto.

* test-env.el (test-base64-encode-string-has-no-line-break-argument,
test-base64-encode-region-has-no-line-break-argument): New functions.
(test-base64-encode-4, test-base64-encode-5): Use them.

* WL-MK (test-wl): Renamed from check-wl.
(check-wl): New function.

* Makefile (check): Don't use `-q -no-site-file'.
(BATCHFLAG): New variable.
(check): Use it.
(test): New rule.

ChangeLog
Makefile
WL-MK
tests/ChangeLog
tests/check-base64.el [new file with mode: 0644]
tests/check-modules.el [new file with mode: 0644]
tests/test-env.el [deleted file]

index 00d0224..a21fcee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2001-08-30  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * WL-MK (test-wl): Renamed from check-wl.
+       (check-wl): New function.
+
+       * Makefile (check): Don't use `-q -no-site-file'.
+       (BATCHFLAG): New variable.
+       (check): Use it.
+       (test): New rule.
+
 2001-08-29  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * WL-ELS (WL-MODULES): Added wl-acap.
index e503716..57c1aef 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,13 +24,17 @@ PIXMAPDIR = NONE
 
 
 ################# No need to modify following lines ####################
-FLAGS   = -batch -q -no-site-file
+BATCHFLAG = -batch
+FLAGS     = $(BATCHFLAG) -q -no-site-file
 
 elc:
        $(EMACS) $(FLAGS) -l WL-MK -f compile-wl-package $(LISPDIR) $(PIXMAPDIR)
 
 check:
-       $(EMACS) $(FLAGS) -l WL-MK -f check-wl $(LISPDIR) $(PIXMAPDIR)
+       $(EMACS) $(BATCHFLAG) -l WL-MK -f check-wl $(LISPDIR) $(PIXMAPDIR)
+
+test:
+       $(EMACS) $(FLAGS) -l WL-MK -f test-wl $(LISPDIR) $(PIXMAPDIR)
 
 install-elc:
        $(EMACS) $(FLAGS) -l WL-MK -f install-wl-package $(LISPDIR) $(PIXMAPDIR)
diff --git a/WL-MK b/WL-MK
index fb20044..6e49363 100644 (file)
--- a/WL-MK
+++ b/WL-MK
   (config-wl-pixmap-dir)
   (princ "\n"))
 
-(defun check-wl ()
+(defun test-wl ()
   (config-wl-package)
   (require 'lunit)
   (let ((files (directory-files "tests" t "^test-.*\\.el$"))
       (setq files (cdr files)))
     (lunit suite)))
 
+(defun check-wl ()
+  (config-wl-package)
+  (require 'lunit)
+  (let ((files (directory-files "tests" t "^check-.*\\.el$"))
+       (suite (lunit-make-test-suite)))
+    (while files
+      (if (file-regular-p (car files))
+         (progn
+           (load-file (car files))
+           (lunit-test-suite-add-test
+            suite (lunit-make-test-suite-from-class
+                   (intern (file-name-sans-extension
+                            (file-name-nondirectory (car files))))))))
+      (setq files (cdr files)))
+    (lunit suite)))
+
 (defun wl-scan-source (path)
   (let (ret)
     (mapcar
index 847ea74..c96a939 100644 (file)
@@ -1,3 +1,15 @@
+2001-08-30  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * test-env.el: Removed (Separated to check-*.el).
+
+       * check-base64.el: New file.
+
+       * check-modules.el: Ditto.
+
+       * test-env.el (test-base64-encode-string-has-no-line-break-argument,
+       test-base64-encode-region-has-no-line-break-argument): New functions.
+       (test-base64-encode-4, test-base64-encode-5): Use them.
+
 2001-08-29  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * test-env.el (test-base64-encode-4, test-base64-encode-5):
diff --git a/tests/check-base64.el b/tests/check-base64.el
new file mode 100644 (file)
index 0000000..1f34764
--- /dev/null
@@ -0,0 +1,55 @@
+(require 'lunit)
+(require 'wl)
+
+(luna-define-class check-base64 (lunit-test-case))
+
+;; mel-b-ccl on XEmacs 21.1
+;;  <http://lists.airs.net/wl/archive/200101/msg00075.html>
+(luna-define-method check-base64-encode-1 ((case check-base64))
+  (require 'elmo-util)
+  (lunit-assert
+   (string=
+    "QQ=="
+    (elmo-base64-encode-string "A"))))
+
+(luna-define-method check-base64-encode-2 ((case check-base64))
+  (require 'elmo-util)
+  (lunit-assert
+   (string=
+    "QUE="
+    (elmo-base64-encode-string "AA"))))
+
+(luna-define-method check-base64-encode-3 ((case check-base64))
+  (require 'elmo-util)
+  (lunit-assert
+   (string=
+    "QUFB"
+    (elmo-base64-encode-string "AAA"))))
+
+;; Old base64 module on XEmacs 21.1
+;;  <http://lists.airs.net/wl/archive/200104/msg00150.html>
+(defun check-base64-encode-string-has-no-line-break-argument ()
+  (require 'elmo-util)
+  (condition-case nil
+      (elmo-base64-encode-string "" t)
+    (wrong-number-of-arguments)))
+
+(luna-define-method check-base64-encode-4 ((case check-base64))
+  (lunit-assert
+   (check-base64-encode-string-has-no-line-break-argument)))
+
+;;  <http://lists.airs.net/wl/archive/200107/msg00121.html>
+
+(defun check-base64-encode-region-has-no-line-break-argument ()
+  (require 'mel)
+  (condition-case nil
+      (with-temp-buffer
+       (funcall (mel-find-function 'mime-encode-region "base64")
+                (point-min) (point-max) t)
+       t)
+    (wrong-number-of-arguments)))
+
+(luna-define-method check-base64-encode-5 ((case check-base64))
+  (lunit-assert
+   (check-base64-encode-region-has-no-line-break-argument)))
+
diff --git a/tests/check-modules.el b/tests/check-modules.el
new file mode 100644 (file)
index 0000000..8adc3bb
--- /dev/null
@@ -0,0 +1,14 @@
+(require 'lunit)
+(require 'wl)
+
+(luna-define-class check-modules (lunit-test-case))
+
+;;;
+;;; environment test for user (not for developer)
+;;;
+
+;; APEL
+(luna-define-method check-modules-apel-version ((case check-modules))
+  (require 'apel-ver)
+  (lunit-assert
+   (product-version>= (product-find 'apel-ver) '(10 2))))
diff --git a/tests/test-env.el b/tests/test-env.el
deleted file mode 100644 (file)
index 3c91210..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-(require 'lunit)
-(require 'wl)
-
-(luna-define-class test-env (lunit-test-case))
-
-;;;
-;;; environment test for user (not for developer)
-;;;
-
-;; APEL
-(luna-define-method test-apel-version ((case test-env))
-  (require 'apel-ver)
-  (lunit-assert
-   (product-version>= (product-find 'apel-ver) '(10 2))))
-
-
-;; mel-b-ccl on XEmacs 21.1
-;;  <http://lists.airs.net/wl/archive/200101/msg00075.html>
-(luna-define-method test-base64-encode-1 ((case test-env))
-  (require 'elmo-util)
-  (lunit-assert
-   (string=
-    "QQ=="
-    (elmo-base64-encode-string "A"))))
-
-(luna-define-method test-base64-encode-2 ((case test-env))
-  (require 'elmo-util)
-  (lunit-assert
-   (string=
-    "QUE="
-    (elmo-base64-encode-string "AA"))))
-
-(luna-define-method test-base64-encode-3 ((case test-env))
-  (require 'elmo-util)
-  (lunit-assert
-   (string=
-    "QUFB"
-    (elmo-base64-encode-string "AAA"))))
-
-;; Old base64 module on XEmacs 21.1
-;;  <http://lists.airs.net/wl/archive/200104/msg00150.html>
-(luna-define-method test-base64-encode-4 ((case test-env))
-  (require 'elmo-util)
-  (lunit-assert
-   (condition-case nil
-       (elmo-base64-encode-string "" t)
-     (wrong-number-of-arguments))))
-
-;;  <http://lists.airs.net/wl/archive/200107/msg00121.html>
-(luna-define-method test-base64-encode-5 ((case test-env))
-  (require 'mel)
-  (lunit-assert
-   (condition-case nil
-       (with-temp-buffer
-        (funcall (mel-find-function 'mime-encode-region "base64")
-                 (point-min) (point-max) t)
-        t)
-     (wrong-number-of-arguments))))