From: teranisi Date: Thu, 30 Aug 2001 00:59:23 +0000 (+0000) Subject: * test-env.el: Removed (Separated to check-*.el). X-Git-Tag: wl-2_7_4~56 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=32349971724768a46901c004c6b8853b08391682;p=elisp%2Fwanderlust.git * 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. * 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. --- diff --git a/ChangeLog b/ChangeLog index 00d0224..a21fcee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-08-30 Yuuichi Teranishi + + * 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 * WL-ELS (WL-MODULES): Added wl-acap. diff --git a/Makefile b/Makefile index e503716..57c1aef 100644 --- 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 --- a/WL-MK +++ b/WL-MK @@ -146,7 +146,7 @@ (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$")) @@ -162,6 +162,22 @@ (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 diff --git a/tests/ChangeLog b/tests/ChangeLog index 847ea74..c96a939 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,15 @@ +2001-08-30 Yuuichi Teranishi + + * 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 * 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 index 0000000..1f34764 --- /dev/null +++ b/tests/check-base64.el @@ -0,0 +1,55 @@ +(require 'lunit) +(require 'wl) + +(luna-define-class check-base64 (lunit-test-case)) + +;; mel-b-ccl on XEmacs 21.1 +;; +(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 +;; +(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))) + +;; + +(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 index 0000000..8adc3bb --- /dev/null +++ b/tests/check-modules.el @@ -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 index 3c91210..0000000 --- a/tests/test-env.el +++ /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 -;; -(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 -;; -(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)))) - -;; -(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))))