+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 img t/tmp/in t/tmp/out --verbose);
+
+my $magick = new Image::Magick;
+my $SVGS_WORK = defined $magick->QueryFormat("svg");
+
+$magick->Read("t/img/twopages.pdf");
+my $PDFS_WORK = defined $magick->Get("width");