]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Call the tests during package build
authorDon Armstrong <don@volo>
Sun, 19 Mar 2006 05:20:11 +0000 (21:20 -0800)
committerDon Armstrong <don@volo>
Sun, 19 Mar 2006 05:20:11 +0000 (21:20 -0800)
 * Add a test target to call the appropriate perl tests
 * Small fix to 01_mime.t

Makefile
debian/rules
t/01_mime.t

index fda9d782f4609c785e108b5b679f2675aa9c6a0f..015ef957ed9824499b231b2f401f92ce86baeee9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,9 @@ perls         := $(foreach name,Log MIME Mail Packages Versions,Debbugs/$(name).pm)
 install_exec   := install -m755 -p
 install_data   := install -m644 -p
 
+test:
+       perl -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))'
+
 install: install_mostfiles
        # install basic debbugs documentation
        $(install_data) COPYING UPGRADE README debian/README.mail $(doc_dir)
@@ -34,6 +37,11 @@ $(var_dir)/spool/lock $(var_dir)/spool/archive $(var_dir)/spool/incoming \
 $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \
           do test -d $$dir || $(install_exec) -d $$dir; done
 
+       # make db-h spool dirs if they don't exist
+       cd $(var_dir)/spool/db-h; \
+         for dir in $(shell seq -w 00 99); \
+           do test -d $$dir || $(install_exec) -d $$dir; done
+
        # install the scripts
        $(foreach script,$(scripts_in), $(install_exec) $(script) $(scripts_dir)/$(patsubst scripts/%.in,%,$(script));)
        $(install_data) scripts/errorlib.in $(scripts_dir)/errorlib
@@ -50,6 +58,7 @@ $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \
        # install the HTML pages etc
        $(foreach html, $(htmls_in), $(install_data) $(html) $(etc_dir)/html;)
        $(install_data) html/htaccess $(var_dir)/www/db/.htaccess
+       $(install_data) html/bugs.css $(var_dir)/www/bugs.css
 
        # install the CGIs
        for cgi in $(cgis); do $(install_exec) $$cgi $(var_dir)/www/cgi; done
@@ -68,3 +77,5 @@ $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \
 
        # install the updateseqs file
        $(install_data) misc/updateseqs $(var_dir)/spool
+
+.PHONY: test
\ No newline at end of file
index 0929fc3f7d4c821cb34f7038cdd4ed2871fac37e..3b65094c4193555b95a66a55fd6a81e1915ab95c 100755 (executable)
@@ -9,7 +9,8 @@
 tmp_dir                := $(CURDIR)/debian/tmp
 
 build:
-# There is nothing to build here, so this rule can be left empty.
+# Call the test suite
+       $(MAKE) test
 
 clean:
        dh_testdir
index ed16d7043a376a61c95eb226396c28082e349044..acffce93ad0a94e85e43891d5aa2c7d538c1e569 100644 (file)
@@ -7,6 +7,7 @@ use warnings;
 use strict;
 
 use utf8;
+use Encode;
 
 use_ok('Debbugs::MIME');
 
@@ -16,9 +17,10 @@ my $test_str = <<'END';
 Döñ Ärḿßtrøñĝ <don@donarmstrong.com>
 END
 
+
 # 1: test decode
 ok(Debbugs::MIME::decode_rfc1522(q(=?iso-8859-1?Q?D=F6n_Armstr=F3ng?= <don@donarmstrong.com>)) eq
-  q(Dön Armstróng <don@donarmstrong.com>),"decode_rfc1522 decodes and converts to UTF8 properly");
+  encode_utf8(q(Dön Armstróng <don@donarmstrong.com>)),"decode_rfc1522 decodes and converts to UTF8 properly");
 
 
 # 2: test encode