X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9497fc1b6c665ca7eb9ca0b5a0b1ad699e040c49..6b322448ca57a3f23dbba975f84bcbb822a36413:/t/inline.t?ds=sidebyside diff --git a/t/inline.t b/t/inline.t index f2ffbbc2f..41957f89e 100755 --- a/t/inline.t +++ b/t/inline.t @@ -4,6 +4,24 @@ use strict; use Test::More; use IkiWiki; +my $installed = $ENV{INSTALLED_TESTS}; + +my @command; +if ($installed) { + @command = qw(ikiwiki); +} +else { + ok(! system("make -s ikiwiki.out")); + @command = qw(perl -I. ./ikiwiki.out + --underlaydir=underlays/basewiki + --set underlaydirbase=underlays + --templatedir=templates); +} + +push @command, qw(--set usedirs=0 --plugin inline + --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi + --rss --atom t/tmp/in t/tmp/out --verbose); + my $blob; my $add_new_post = gettext("Add a new post titled:"); @@ -35,13 +53,8 @@ foreach my $page (qw(protagonists/shepard protagonists/link write_old_file("$page.mdwn", "this page is {$page}"); } -ok(! system("make -s ikiwiki.out")); - -my $command = "perl -I. ./ikiwiki.out --set usedirs=0 --plugin inline --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi --rss --atom --underlaydir=underlays/basewiki --set underlaydirbase=underlays --templatedir=templates t/tmp/in t/tmp/out --verbose"; - -ok(! system($command)); - -ok(! system("$command --refresh")); +ok(! system(@command)); +ok(! system(@command, "--refresh")); $blob = readfile("t/tmp/out/protagonists.html"); like($blob, qr{\Q$add_new_post\E}, 'rootpage=yes gives postform'); @@ -52,7 +65,7 @@ $blob = readfile("t/tmp/out/friends.html"); like($blob, qr{\Q$add_new_post\E}, 'postform=yes forces postform'); like($blob, qr{