Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item11091: Item10961: Item10993: handling of missing ,v files revised…
…, with the store now behaving correctly if a .txt,v is missing or inconsistent with .txt. Note that this *will not work* if used with a file system that does not maintain file modification times, or a perl that doesn't report them correctly, or an RCS that assigns a more recently file time to the .txt than that on the .txt,v. I also have some conserns about performance, but based on my benchmarking can't nail anything down. git-svn-id: http://svn.foswiki.org/branches/Release01x01@12497 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information
CrawfordCurrie
authored and
CrawfordCurrie
committed
Sep 11, 2011
1 parent
45dd367
commit a5f1985
Showing
21 changed files
with
949 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package FoswikiStoreTestCase; | ||
|
||
# Specialisation of FoswikiFnTestCase used to perform tests over all | ||
# viable store implementations. | ||
# | ||
# Subclasses are expected to implement set_up_for_verify() | ||
# | ||
use FoswikiFnTestCase; | ||
our @ISA = qw( FoswikiFnTestCase ); | ||
|
||
# Determine if RCS is installed. used in tests for RCS functionality. | ||
our $rcs_installed; | ||
sub rcs_is_installed { | ||
if (!defined($rcs_installed)) { | ||
eval { | ||
`co -V`; # Check to see if we have co | ||
}; | ||
if ( $@ || $? ) { | ||
$rcs_installed = 0; | ||
print STDERR "*** CANNOT RUN RcsWrap TESTS - NO COMPATIBLE co: $@\n"; | ||
} else { | ||
$rcs_installed = 1; | ||
} | ||
} | ||
return $rcs_installed; | ||
} | ||
|
||
sub set_up { | ||
my $this = shift; | ||
|
||
$this->SUPER::set_up(); | ||
} | ||
|
||
sub tear_down { | ||
my $this = shift; | ||
|
||
$this->SUPER::tear_down(); | ||
} | ||
|
||
sub set_up_for_verify { | ||
die "ABSTRACT BASE CLASS"; | ||
} | ||
|
||
sub fixture_groups { | ||
my @groups; | ||
foreach my $dir (@INC) { | ||
if ( opendir( D, "$dir/Foswiki/Store" ) ) { | ||
foreach my $alg ( readdir D ) { | ||
next unless $alg =~ s/^(.*)\.pm$/$1/; | ||
next if defined &$alg; | ||
$ENV{PATH} =~ /^(.*)$/ms; | ||
$ENV{PATH} = $1; | ||
next if $alg =~ /RcsWrap/ && !rcs_is_installed(); | ||
($alg) = $alg =~ /^(.*)$/ms; | ||
eval "require Foswiki::Store::$alg"; | ||
die $@ if $@; | ||
no strict 'refs'; | ||
*$alg = sub { | ||
my $this = shift; | ||
$Foswiki::cfg{Store}{Implementation} = | ||
'Foswiki::Store::'.$alg; | ||
$this->set_up_for_verify(); | ||
}; | ||
use strict 'refs'; | ||
push(@groups, $alg); | ||
} | ||
closedir(D); | ||
} | ||
} | ||
return \@groups; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.