X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fblosxom.git;a=blobdiff_plain;f=t%2Fdriver.t;fp=t%2Fdriver.t;h=0000000000000000000000000000000000000000;hp=36ae5ef2f9fe130ae2838cc9491d07dc56955dfe;hb=175a8afc17dc934e433967d7f3c6797a89a17424;hpb=4765205bf6e8c276bc0bbb277cba30dff8a5ee67 diff --git a/t/driver.t b/t/driver.t deleted file mode 100755 index 36ae5ef..0000000 --- a/t/driver.t +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use Test::More qw( no_plan ); - -use File::Copy; -use File::Compare; -use File::Find; -use Cwd; -use YAML; - - -my $orig_cwd = cwd(); - -opendir(my $dh, $orig_cwd) or die("Opendir failed: $!"); - -my @tests = grep { /^t-/ } readdir $dh; - -for my $testdir (@tests) { - my (undef, $test) = split /-/, $testdir, 2; - - chdir $testdir; - my $cwd = cwd(); - - my $spec = YAML::LoadFile ("spec.yaml"); - - if (! $spec) { - fail ("$test - loading spec"); - next; - } - - my $success = 1; - - copy("../../blosxom.cgi", ".") or die("Copy failed: $!"); - chmod(0777, "blosxom.cgi"); - - system("perl -pi -e 's{/Library/WebServer/Documents/blosxom}{$cwd/data}' blosxom.cgi") == 0 - or die "$!"; - - touch_files (); - - for (@{$spec->{tests}}) { - my ($args, $output) = @$_; - - system("./blosxom.cgi $args > ${output}.got") == 0 - or die "$!"; - - if (ok(compare("${output}.got", $output) == 0, - "$test - Got expected output for args [$args]")) { - unlink("${output}.got"); - } else { - $success = 0; - } - } - - if ($success) { - unlink("blosxom.cgi"); - } - - chdir $orig_cwd; -} - - - -sub touch_files { - find( sub { - if (/^(.*)\.(\d+)$/) { - copy($_, $1); - `touch -t $2 $1`; - } - }, - "./data"); -}