|
From: <jgr...@us...> - 2003-10-13 20:23:47
|
Update of /cvsroot/popfile/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv28571
Modified Files:
bayes.pl license tests.pl
Log Message:
FINAL PREPARATIONS FOR V0.20.0
Bring test suite to as close to 100% coverage as possible
Clean up Japanese/Korean code for better maintainability
Fix problem with random test suite crashes
Proxy/POP3.pm:
Add code to upgrade the welcome_string if the user has not
changed it from the default in a previous version of POPFile.
Classifier/Bayes.pm:
Remove a lot of code that was duplicated because of
the addition of Japanese and Korean support. To do
so created two helper methods: add_words_to_bucket__
and magnet_match__. There's still some duplicated code
(e.g. calls to these functions) but I can't find a good
way to deal with 'no locale' other than this.
Add hints for the code coverage about blocks of code.
Change the word scores code so that the scores are not
calculated if not required.
UI/HTML.pm:
Handle the display and non-display of the word matrix,
remove the stickiness of the word table format since
POPFile has not other 'sticky' values at this point.
Remove duplicated code introduced by Japanese and
Korean support.
tests.pl:
Accept multiple patterns on the command line so that
multiple tests can be specified at once. Patterns are
separated by commas. e.g. to run the HTTP and MailParse
test suites do:
gmake test TESTARGS=HTTP,MailParse
license:
Incorporate information about the BerkeleyDB license.
tests/TestWordMangle.tst:
Add tests for Japanese stop word support.
tests/TestModule.tst:
Add calls to dummy parent methods that do nothing, done
to get coverage to 100%.
tests/TestMailParse.tst
tests/TestPOP3.tst
tests/TestHTML.tst:
Make sure to stop the Bayes module to close the database.
tests/TestHTML.script:
Add tests for the new Single Message View where the word
matrix is not expanded by default. Test with and without
the word matrix and test the different views.
Added tests for Japanese and Korean stop words.
tests/TestProxy.tst:
Add tests for echo_response_'s handling of timeouts.
tests/languages/Korean.msg
tests/languages/Nihongo.msg:
Added the Korean and Japanese language files.
tests/TestMailParse022.cam
tests/TestMailParse022.wrd
tests/TestMailParse022.msg:
Split the From and Subject line to check the new
long header support.
tests/TestMailParse019.clr
tests/TestMailParse015.clr:
The information in this appeared to be wrong, so updated
to the latest output.
tests/TestMailParse.tst:
Add TestMailParse019 to the colorization tests.
Index: bayes.pl
===================================================================
RCS file: /cvsroot/popfile/engine/bayes.pl,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** bayes.pl 31 Jul 2003 16:32:20 -0000 1.23
--- bayes.pl 13 Oct 2003 20:23:40 -0000 1.24
***************
*** 62,66 ****
$b->start();
-
my @files = glob $ARGV[0];
foreach my $file (@files) {
--- 62,65 ----
Index: license
===================================================================
RCS file: /cvsroot/popfile/engine/license,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** license 31 Jul 2003 16:32:20 -0000 1.2
--- license 13 Oct 2003 20:23:40 -0000 1.3
***************
*** 1,2 ****
--- 1,10 ----
+ This file describes POPFile's license:
+
+ POPFile is licensed in the GNU General Public License in section 1 below.
+ POPFile uses the BerkeleyDB, see section 2 below.
+
+
+ 1. POPFile's License
+
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
***************
*** 341,342 ****
--- 349,374 ----
+ 2. BerkeleyDB License
+
+ Copyright (c) 1997-2003 Paul Marquess. All rights reserved. This program is
+ free software; you can redistribute it and/or modify it under the same
+ terms as Perl itself.
+
+ Although BerkeleyDB is covered by the Perl license, the library it makes
+ use of, namely Berkeley DB, is not. Berkeley DB has its own copyright and
+ its own license. Please take the time to read it.
+
+ Here are few words taken from the Berkeley DB FAQ (at
+ http://www.sleepycat.com) regarding the license:
+
+ Do I have to license DB to use it in Perl scripts?
+
+ No. The Berkeley DB license requires that software that uses
+ Berkeley DB be freely redistributable. In the case of Perl, that
+ software is Perl, and not your scripts. Any Perl scripts that you
+ write are your property, including scripts that make use of Berkeley
+ DB. Neither the Perl license nor the Berkeley DB license
+ place any restriction on what you may do with them.
+
+ If you are in any doubt about the license situation, contact either the
+ Berkeley DB authors or the author of BerkeleyDB. See AUTHOR for details.
Index: tests.pl
===================================================================
RCS file: /cvsroot/popfile/engine/tests.pl,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** tests.pl 15 Sep 2003 14:55:36 -0000 1.30
--- tests.pl 13 Oct 2003 20:23:40 -0000 1.31
***************
*** 161,165 ****
# MAIN
! my @tests = glob '*.tst';
# Either match all the possible tests, or take the first argument
--- 161,165 ----
# MAIN
! my @tests = sort { $b cmp $a } glob '*.tst';
# Either match all the possible tests, or take the first argument
***************
*** 168,173 ****
# to be run
! my $pattern = '.*';
! $pattern = "$ARGV[0].*" if ( $#ARGV == 0 );
my $code = 0;
--- 168,173 ----
# to be run
! my @patterns= ( '.*' );
! @patterns = split( /,/, $ARGV[0] ) if ( $#ARGV == 0 );
my $code = 0;
***************
*** 175,179 ****
foreach my $test (@tests) {
! if ( $test =~ /$pattern/ ) {
# This works by reading the entire suite into the $suite variable
--- 175,188 ----
foreach my $test (@tests) {
! my $runit = 0;
!
! foreach my $pattern (@patterns) {
! if ( $test =~ /$pattern/ ) {
! $runit = 1;
! last;
! }
! }
!
! if ( $runit ) {
# This works by reading the entire suite into the $suite variable
***************
*** 181,187 ****
# the line number and the file they are from, then the $suite is
# evaluated
my $current_test_count = $test_count;
my $current_error_count = $test_failures;
!
print "\nRunning $test... ";
flush STDOUT;
--- 190,197 ----
# the line number and the file they are from, then the $suite is
# evaluated
+
my $current_test_count = $test_count;
my $current_error_count = $test_failures;
!
print "\nRunning $test... ";
flush STDOUT;
***************
*** 200,208 ****
}
close SUITE;
! if ( !defined( eval $suite ) ) {
print "Error in $test: $@";
$code = 1;
}
!
if ( $test_failures > $current_error_count ) {
print "failed (" . ( $test_count - $current_test_count ) . " ok, " . ( $test_failures - $current_error_count ) . " failed)\n";
--- 210,221 ----
}
close SUITE;
!
! my $ran = eval( $suite );
!
! if ( !defined( $ran ) ) {
print "Error in $test: $@";
$code = 1;
}
!
if ( $test_failures > $current_error_count ) {
print "failed (" . ( $test_count - $current_test_count ) . " ok, " . ( $test_failures - $current_error_count ) . " failed)\n";
|