X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7b06a65221ae16bf447c591dba5712c1d9f00461..851d556d5b448d899599b8e63d259456c76ca1bd:/t/trail.t?ds=inline diff --git a/t/trail.t b/t/trail.t index dce3b3c7e..ed180d35c 100755 --- a/t/trail.t +++ b/t/trail.t @@ -1,7 +1,8 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More 'no_plan'; +use Cwd qw(getcwd); +use Test::More; use IkiWiki; sub check_trail { @@ -27,6 +28,24 @@ my $blob; ok(! system("rm -rf t/tmp")); ok(! system("mkdir t/tmp")); +my $installed = $ENV{INSTALLED_TESTS}; + +my @command; +if ($installed) { + @command = qw(ikiwiki); +} +else { + ok(! system("make -s ikiwiki.out")); + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out + --underlaydir=underlays/basewiki + --set underlaydirbase=underlays + --templatedir=templates)); +} + +push @command, qw(--set usedirs=0 --plugin trail --plugin inline + --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi + --rss --atom t/tmp/in t/tmp/out --verbose); + # Write files with a date in the past, so that when we refresh, # the update is detected. sub write_old_file { @@ -129,13 +148,8 @@ write_old_file("wind_in_the_willows.mdwn", <badger<\/a>/m); @@ -232,7 +246,7 @@ writefile("limited/c.mdwn", "t/tmp/in", '[[!meta title="New C page"]]c'); writefile("untrail.mdwn", "t/tmp/in", "no longer a trail"); -ok(! system("$command -refresh")); +ok(! system(@command, "--refresh")); check_trail("add/a.html", "n=add/b p="); check_trail("add/b.html", "n=add/c p=add/a"); @@ -290,3 +304,5 @@ check_no_trail("untrail/a.html"); check_no_trail("untrail/b.html"); ok(! system("rm -rf t/tmp")); + +done_testing();