[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kinosearch-commits
Subject:    [Kinosearch-commits] r2496 - in trunk/perl: buildlib t
From:       marvin () rectangular ! com (marvin () rectangular ! com)
Date:       2007-08-19 16:28:27
Message-ID: mailman.6.1187566107.555.kinosearch-commits () rectangular ! com
[Download RAW message or body]

Author: root
Date: 2007-08-19 16:28:26 -0700 (Sun, 19 Aug 2007)
New Revision: 2496

Modified:
   trunk/perl/buildlib/KinoTestUtils.pm
   trunk/perl/t/106-locking.t
   trunk/perl/t/999-remove_invindexes.t
Log:
Clean up the locking test invindex.


Modified: trunk/perl/buildlib/KinoTestUtils.pm
===================================================================
--- trunk/perl/buildlib/KinoTestUtils.pm	2007-08-19 22:50:16 UTC (rev 2495)
+++ trunk/perl/buildlib/KinoTestUtils.pm	2007-08-19 23:28:26 UTC (rev 2496)
@@ -8,6 +8,7 @@
     create_invindex
     create_uscon_invindex
     path_for_test_invindex
+    path_for_lock_test_invindex 
     get_uscon_docs
     utf8_test_strings
     test_analyzer
@@ -159,4 +160,11 @@
     Test::More::is_deeply( \@got, $expected, "analyze_field: $message" );
 }
 
+# Return a location for the test invindex used by the locking test.  Because
+# that test uses multiple processes, it can't clean up after itself -- so we
+# put the cleanup in another test file.
+sub path_for_lock_test_invindex {
+    return catdir( tmpdir(), 'lock_test_invindex' );
+}
+
 1;

Modified: trunk/perl/t/106-locking.t
===================================================================
--- trunk/perl/t/106-locking.t	2007-08-19 22:50:16 UTC (rev 2495)
+++ trunk/perl/t/106-locking.t	2007-08-19 23:28:26 UTC (rev 2496)
@@ -1,10 +1,12 @@
 use strict;
 use warnings;
+use lib 'buildlib';
 
 use Time::HiRes qw( sleep );
 use Test::More;
 use File::Spec::Functions qw( tmpdir catdir catfile );
 use File::Path qw( rmtree );
+use KinoTestUtils qw( path_for_lock_test_invindex); 
 
 BEGIN {
     if ( $^O =~ /mswin/i ) {
@@ -18,7 +20,7 @@
 use KinoSearch::Store::Lock;
 use KinoSearch::Store::FSFolder;
 
-my $path = catdir( tmpdir(), "lock_test_invindex" );
+my $path = path_for_lock_test_invindex();
 rmtree($path);
 mkdir $path or die "Can't mkdir '$path': $!";
 

Modified: trunk/perl/t/999-remove_invindexes.t
===================================================================
--- trunk/perl/t/999-remove_invindexes.t	2007-08-19 22:50:16 UTC (rev 2495)
+++ trunk/perl/t/999-remove_invindexes.t	2007-08-19 23:28:26 UTC (rev 2496)
@@ -3,12 +3,14 @@
 use lib 'buildlib';
 
 use File::Path qw( rmtree );
-use Test::More tests => 1;
+use Test::More tests => 2;
 
-use KinoTestUtils qw( path_for_test_invindex );
+use KinoTestUtils qw( path_for_test_invindex path_for_lock_test_invindex );
 
 rmtree( path_for_test_invindex() );
+ok(!-e path_for_test_invindex(), "test_invindex loc swept");
+rmtree( path_for_lock_test_invindex() );
+ok(!-e path_for_lock_test_invindex(), "lock_test_invindex loc swept");
 
-ok( 1, "dummy test" );
 
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic