From: Gavin Carr Date: Fri, 7 Dec 2007 06:00:44 +0000 (+0000) Subject: Test updates. X-Git-Tag: debian/2.1.2-2~56 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=4a16d1aab497d555ec62373dc324e6086ea2eb7c;p=pkg%2Fblosxom.git Test updates. --- diff --git a/t/driver b/t/driver index 574276b..52fc128 100644 --- a/t/driver +++ b/t/driver @@ -28,8 +28,20 @@ die "cannot find blosxom config dir '$blosxom_config_dir'" unless -d $blosxom_co $ENV{BLOSXOM_CONFIG_DIR} = $blosxom_config_dir; $ENV{TZ} = 'UTC'; -my $blosxom_cgi = "$testdir/../../blosxom.cgi"; -die "cannot find blosxom.cgi '$blosxom_cgi'" unless -f $blosxom_cgi; +my $blosxom_cgi = $ENV{BLOSXOM_CGI}; +unless ($blosxom_cgi && -f $blosxom_cgi) { + if (-f "$testdir/../../blosxom.cgi") { + $blosxom_cgi = "$testdir/../../blosxom.cgi"; + warn "ignoring BLOSXOM_CGI setting '$ENV{BLOSXOM_CGI}' - using '$blosxom_cgi' instead" + if $ENV{BLOSXOM_CGI}; + } + elsif ($blosxom_cgi) { + die "cannot find blosxom.cgi '$blosxom_cgi' - check your BLOSXOM_CGI environment variable"; + } + else { + die "cannot find blosxom.cgi - please set the BLOSXOM_CGI environment variable"; + } +} die "blosxom.cgi '$blosxom_cgi' is not executable" unless -x $blosxom_cgi; my $spec = YAML::LoadFile ("$testdir/spec.yaml") @@ -68,6 +80,7 @@ if ($static_password) { my ($a_short, $b_short) = ($a, $b); $a_short =~ s!^.*\.\./!! if $a_short; $b_short =~ s!^.*\.\./!! if $b_short; + return if $b =~ m! /CVS$ !x; if (! $b) { fail("$a_short has no corresponding file"); } elsif (! $a) { @@ -91,6 +104,9 @@ if ($static_password) { eq_or_diff($got, $expected, "file $a_short and $b_short match", { style => 'Unified' }); } }, { ignore_cmp => 1 }); + + # Cleanup static output + File::Remove::remove(\1, "$static_dir/*") unless $ENV{BLOSXOM_STATIC_NO_CLEANUP}; } }