aboutsummaryrefslogtreecommitdiff
path: root/t/trail.t
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2015-11-30 17:33:00 +0000
committerSimon McVittie <smcv@debian.org>2015-11-30 18:26:22 +0000
commitcdfb4ab1a3c60bf699b8d77618ec9bdf526cdb35 (patch)
tree6a33fd51436d66178fdfab689a8c6076cefa1c54 /t/trail.t
parent78a47d44c7c7d798c0a16c17954caef57e4c192e (diff)
downloadikiwiki-cdfb4ab1a3c60bf699b8d77618ec9bdf526cdb35.tar
ikiwiki-cdfb4ab1a3c60bf699b8d77618ec9bdf526cdb35.tar.gz
Run autopkgtest tests using autodep8 and the pkg-perl team's infrastructure
Diffstat (limited to 't/trail.t')
-rwxr-xr-xt/trail.t33
1 files changed, 24 insertions, 9 deletions
diff --git a/t/trail.t b/t/trail.t
index bde812887..cac64c366 100755
--- a/t/trail.t
+++ b/t/trail.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More 'no_plan';
+use Test::More;
use IkiWiki;
sub check_trail {
@@ -27,6 +27,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 = qw(perl -I. ./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 +147,8 @@ write_old_file("wind_in_the_willows.mdwn", <<EOF
EOF
);
-ok(! system("make -s ikiwiki.out"));
-
-my $command = "perl -I. ./ikiwiki.out --set usedirs=0 --plugin trail --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/meme.html");
ok($blob =~ /<a href="(\.\/)?badger.html">badger<\/a>/m);
@@ -232,7 +245,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 +303,5 @@ check_no_trail("untrail/a.html");
check_no_trail("untrail/b.html");
ok(! system("rm -rf t/tmp"));
+
+done_testing();