6 my $installed = $ENV{INSTALLED_TESTS};
8 ok(! system("rm -rf t/tmp; mkdir t/tmp"));
12 @command = qw(env LC_ALL=C ikiwiki);
15 ok(! system("make -s ikiwiki.out"));
16 ok(! system("make underlay_install DESTDIR=`pwd`/t/tmp/install PREFIX=/usr >/dev/null"));
17 @command = qw(env LC_ALL=C perl -I. ./ikiwiki.out
18 --underlaydir=t/tmp/install/usr/share/ikiwiki/basewiki
19 --set underlaydirbase=t/tmp/install/usr/share/ikiwiki
20 --templatedir=templates);
23 foreach my $plugin ("", "listdirectives") {
24 ok(! system(@command, qw(--rebuild --plugin brokenlinks),
25 # always enabled because pages link to it conditionally,
26 # which brokenlinks cannot handle properly
28 ($plugin ? ("--plugin", $plugin) : ()),
29 qw(t/basewiki_brokenlinks t/tmp/out)));
30 my $result=`grep 'no broken links' t/tmp/out/index.html`;
32 if (! length $result) {
33 print STDERR "\n\nbroken links found".($plugin ? " (with $plugin)" : "")."\n";
34 system("grep '<li>' t/tmp/out/index.html >&2");
37 ok(-e "t/tmp/out/style.css"); # linked to..
38 ok(! system("rm -rf t/tmp/out t/basewiki_brokenlinks/.ikiwiki"));
40 ok(! system("rm -rf t/tmp"));