From 1da4d2c2037c64eb6614e32e6b83597b7dc02fca Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sat, 18 Mar 2006 21:20:11 -0800 Subject: [PATCH] * Call the tests during package build * Add a test target to call the appropriate perl tests * Small fix to 01_mime.t --- Makefile | 11 +++++++++++ debian/rules | 3 ++- t/01_mime.t | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fda9d782..015ef957 100644 --- 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 diff --git a/debian/rules b/debian/rules index 0929fc3f..3b65094c 100755 --- a/debian/rules +++ b/debian/rules @@ -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 diff --git a/t/01_mime.t b/t/01_mime.t index ed16d704..acffce93 100644 --- a/t/01_mime.t +++ b/t/01_mime.t @@ -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øñĝ END + # 1: test decode ok(Debbugs::MIME::decode_rfc1522(q(=?iso-8859-1?Q?D=F6n_Armstr=F3ng?= )) eq - q(Dön Armstróng ),"decode_rfc1522 decodes and converts to UTF8 properly"); + encode_utf8(q(Dön Armstróng )),"decode_rfc1522 decodes and converts to UTF8 properly"); # 2: test encode -- 2.39.5