1 ;; -*- lexical-binding: t -*-
6 (luna-define-class test-dist (lunit-test-case))
9 (defvar test-dist-wl-lost-module-list nil)
10 (luna-define-method test-wl-modules-exists ((case test-dist))
11 (setq test-dist-wl-lost-module nil)
14 (let ((filename (concat (symbol-name module) ".el")))
15 (unless (file-exists-p (expand-file-name filename WLDIR))
16 (add-to-list 'test-dist-wl-lost-module-list filename))))
18 (lunit-assert (null test-dist-wl-lost-module-list)))
20 (defvar test-dist-wl-bad-module-list nil)
21 (luna-define-method test-wl-modules-trailing-whitespace ((case test-dist))
22 (setq test-dist-wl-bad-module-list nil)
25 (let ((filename (format "%s.el%s" (symbol-name module)
26 (if (eq 'wl-news module) ".in" ""))))
28 (insert-file-contents (expand-file-name filename WLDIR))
29 (when (re-search-forward "[ \t]$" nil t)
30 (add-to-list 'test-dist-wl-bad-module-list filename)))))
32 (lunit-assert (null test-dist-wl-bad-module-list)))
36 (defvar test-dist-elmo-lost-module-list nil)
37 (luna-define-method test-elmo-modules-exists ((case test-dist))
38 (setq test-dist-elmo-lost-module-list nil)
41 (let ((filename (concat (symbol-name module) ".el")))
42 (unless (file-exists-p (expand-file-name filename ELMODIR))
43 (add-to-list 'test-dist-elmo-lost-module-list filename))))
45 (lunit-assert (null test-dist-elmo-lost-module-list)))
47 (defvar test-dist-elmo-bad-module-list nil)
48 (luna-define-method test-elmo-modules-trailing-whitespace ((case test-dist))
49 (setq test-dist-elmo-bad-module-list nil)
52 (let ((filename (format "%s.el" (symbol-name module))))
54 (insert-file-contents (expand-file-name filename ELMODIR))
55 (when (re-search-forward "[ \t]$" nil t)
56 (add-to-list 'test-dist-elmo-bad-module-list filename)))))
58 (lunit-assert (null test-dist-elmo-bad-module-list)))
62 (defvar test-dist-util-lost-module-list nil)
63 (luna-define-method test-util-modules-exists ((case test-dist))
64 (setq test-dist-util-lost-module-list nil)
67 (let ((filename (concat (symbol-name module) ".el")))
68 (unless (file-exists-p (expand-file-name filename UTILSDIR))
69 (add-to-list 'test-dist-util-lost-module-list symbol))))
71 (lunit-assert (null test-dist-util-lost-module-list)))
73 (defvar test-dist-util-bad-module-list nil)
74 (luna-define-method test-util-modules-trailing-whitespace ((case test-dist))
75 (setq test-dist-util-bad-module-list nil)
78 (let ((filename (format "%s.el" (symbol-name module))))
80 (insert-file-contents (expand-file-name filename UTILSDIR))
81 (when (re-search-forward "[ \t]$" nil t)
82 (add-to-list 'test-dist-util-bad-module-list filename)))))
84 (lunit-assert (null test-dist-util-bad-module-list)))
88 (defvar test-dist-wl-lost-icon-list nil)
89 (luna-define-method test-wl-icon-exists ((case test-dist))
90 (setq test-dist-wl-lost-icon-list nil)
93 (let ((name (symbol-name symbol))
94 (value (and (boundp symbol) (symbol-value symbol))))
95 (when (and (string-match "^wl-.*-icon$" name)
97 (string-match "xpm$" value))
98 (unless (file-exists-p (expand-file-name value ICONDIR))
99 (add-to-list 'test-dist-wl-lost-icon-list symbol))))))
100 (lunit-assert (null test-dist-wl-lost-icon-list)))
102 (luna-define-method test-version-status-icon-xpm ((case test-dist))
106 (expand-file-name (concat (wl-demo-icon-name) ".xpm") ICONDIR))))
108 (luna-define-method test-version-status-icon-xbm ((case test-dist))
112 (expand-file-name (concat (wl-demo-icon-name) ".xbm") ICONDIR))))
115 (luna-define-method test-texi-version ((case test-dist))
116 (require 'wl-version)
119 (product-version-string (product-find 'wl-version))
121 (insert-file-contents (expand-file-name "version.texi" DOCDIR))
122 (re-search-forward "^@set VERSION \\([0-9\.]+\\)$")
126 (luna-define-method test-refcard-version ((case test-dist))
127 (require 'wl-version)
130 (product-version-string (product-find 'wl-version))
132 (insert-file-contents (expand-file-name "version.tex" DOCDIR))
133 (re-search-forward "^\\\\def\\\\versionnumber{\\([0-9\.]+\\)}$")
137 (luna-define-method test-version-wl-changelog ((case test-dist))
138 (require 'wl-version)
141 (product-version-string (product-find 'wl-version))
143 (insert-file-contents (expand-file-name "ChangeLog" WLDIR))
145 "^\t\\* Version number is increased to \\([0-9\\.]+[0-9]\\).$")
149 (luna-define-method test-version-elmo-changelog ((case test-dist))
150 (require 'elmo-version)
153 (product-version-string (product-find 'elmo-version))
155 (insert-file-contents (expand-file-name "ChangeLog" ELMODIR))
157 "^\t\\* elmo-version.el (elmo-version): Up to \\([0-9\\.]+[0-9]\\).$")
160 ;; ChangeLog (toplevel)
161 (luna-define-method test-version-toplevel-changelog ((case test-dist))
162 (require 'wl-version)
163 (when (and (string= (wl-version-status) "stable")
164 ;; pre release version don't check.
167 (product-code-name (product-find 'wl-version)))))
169 (insert-file-contents (expand-file-name "ChangeLog" "./"))
171 "^\t\\* \\([0-9\\.]+\\) - \"\\([^\"]+\\)\"$")
174 (product-version-string (product-find 'wl-version))
178 (product-code-name (product-find 'wl-version))
179 (match-string 2))))))
181 ;; README, README.ja (toplevel)
182 (luna-define-method test-version-readme ((case test-dist))
183 (require 'wl-version)
184 (when (string= (wl-version-status) "stable")
188 (insert-file-contents (expand-file-name file "./"))
189 (re-search-forward "checkout -r wl-\\([0-9]+\\)_\\([0-9]+\\) wanderlust")
191 (= (string-to-number (match-string 1))
192 (nth 0 (product-version (product-find 'wl-version)))))
194 (= (string-to-number (match-string 2))
195 (nth 1 (product-version (product-find 'wl-version)))))))
196 '("README" "README.ja"))))
199 (luna-define-method test-wl-demo-copyright-notice ((case test-dist))
203 (format-time-string "%Y" (current-time))
204 wl-demo-copyright-notice)))