- unless ($expected{$output}) {
- my $fh = IO::File->new("$testdir/$output", 'r')
- or die "cannot open expected output file '$output': $!";
- {
- local $/ = undef;
- $expected{$output} = <$fh>;
- }
- $fh->close;
+ File::Remove::remove(\1, "$static_dir/*");
+
+ my $errors = qx($blosxom_cgi -quiet=1 -password=$static_password);
+ is($errors, '', 'no errors reported from static run');
+ File::DirCompare->compare($static_dir, "$blosxom_config_dir/../" . $spec->{expected}, sub {
+ my ($a, $b) = @_;
+ my ($a_short, $b_short) = ($a, $b);
+ $a_short =~ s!^.*\.\./!! if $a_short;
+ $b_short =~ s!^.*\.\./!! if $b_short;
+ if (! $b) {
+ fail("$a_short has no corresponding file");
+ } elsif (! $a) {
+ fail("$b_short has no corresponding file");
+ } else {
+ my ($got, $expected) = ('', '');
+ my $fh = IO::File->new($a, 'r')
+ or die "cannot open static output file '$a': $!";
+ {
+ local $/ = undef;
+ $got = <$fh>;
+ $fh->close;
+ }
+ $fh = IO::File->new($b, 'r')
+ or die "cannot open static output file '$b': $!";
+ {
+ local $/ = undef;
+ $expected = <$fh>;
+ $fh->close;
+ }
+ eq_or_diff($got, $expected, "file $a_short and $b_short match", { style => 'Unified' });
+ }
+ }, { ignore_cmp => 1 });