When a test fails, it's useful to be able to inspect the output.
Signed-off-by: Simon McVittie <smcv@debian.org>
/t/tmp/
/t/manual/*/git/
/t/manual/*/html/
+/t/tinyblog/.ikiwiki/
+/t/tinypodcast/.ikiwiki/
extra_clean: perl_shebangs_clean
$(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.in --setup docwiki.setup --clean
rm -f *.man $(outprogs) ikiwiki.setup plugins/*.pyc
+ rm -fr t/tmp t/manual/*/git/ t/manual/*/html/ t/tinyblog/.ikiwiki/ t/tinypodcast/.ikiwiki/
$(MAKE) -C po clean
reset-generated:
ok(-e "t/tmp/out/style.css"); # linked to..
ok(! system("rm -rf t/tmp/out t/basewiki_brokenlinks/.ikiwiki"));
}
-ok(! system("rm -rf t/tmp"));
done_testing();
use warnings;
use strict;
use Cwd qw(getcwd);
-use Test::More tests => 106;
+use Test::More;
my $installed = $ENV{INSTALLED_TESTS};
ok(! system("touch $srcdir/foo/index.html"));
setupiki("rawhtml file rendered same as existing page in setup");
-# cleanup
-ok(! system("rm -rf t/tmp"));
+done_testing;
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 20;
+use Test::More;
BEGIN { use_ok("IkiWiki"); }
BEGIN { use_ok("IkiWiki::Render"); }
system("ln -sf /etc/ $config{underlaydir}/ikiwiki/symdir");
test_src_files(\@list, "deep dir symlink in underlaydir skipped");
-
-
-
-cleanup();
+done_testing;
ok(! -e "$outpath/x8-hello:world.png");
ok(! -e "$outpath/x4-a:b:c.png");
ok(! -e "$outpath/x6-a:b:c:d:e:f:g:h:i:j.png");
-
- # cleanup
- ok(! system("rm -rf t/tmp"));
}
done_testing;
BEGIN { use_ok("IkiWiki"); }
+remove_tree("t/tmp");
make_path("t/tmp/libdir");
make_path("t/tmp/libdirs");
make_path("t/tmp/libdirs/1");
ok(grep { m/^ext_plugin_in_libdir_1$/ } @plugins);
ok(grep { m/^ext_plugin_in_libdir_2$/ } @plugins);
-remove_tree("t/tmp/libdir");
-remove_tree("t/tmp/libdirs");
-
done_testing;
node('iv', []),
]);
-ok(! system("rm -rf t/tmp"));
done_testing;
1;
sub write_build_read_compare {
my ($pagename, $input, $expected_output) = @_;
+ ok(! system("rm -rf $tmp"), q{setup});
ok(! system("mkdir -p $srcdir"), q{setup});
writefile("$pagename.mdwn", $srcdir, $input);
ok(! system(@command), q{build});
like(readfile("$destdir/$pagename/index.html"), $expected_output);
- ok(! system("rm -rf $tmp"), q{teardown});
}
write_build_read_compare(
--templatedir=templates));
}
-ok(! system("rm -rf t/tmp"));
+ok(! system("rm -rf t/tmp t/tinyblog/.ikiwiki"));
ok(! system("mkdir t/tmp"));
ok(! system(@command, qw(--plugin inline --url=http://example.com
--cgiurl=http://example.com/ikiwiki.cgi --rss --atom
my $guid="http://example.com/post/";
ok(length `egrep '<guid.*>$guid</guid>' t/tmp/out/index.rss`);
ok(length `egrep '<id>$guid</id>' t/tmp/out/index.atom`);
-ok(! system("rm -rf t/tmp t/tinyblog/.ikiwiki"));
done_testing();
"XML::Feed and/or HTML::Parser or File::MimeInfo not available"};
}
else {
- eval q{use Test::More tests => 137};
+ eval q{use Test::More};
}
}
my @command = (@base_command, qw(--plugin inline --rss --atom));
push @command, "--url=$baseurl", qw(t/tinypodcast), "$tmp/out";
+ ok(! system("rm -rf $tmp $statedir"), q{setup});
+
ok(! system("mkdir $tmp"),
q{setup});
ok(! system(@command),
}
}
}
-
- ok(! system("rm -rf $tmp $statedir"), q{teardown});
}
sub single_page_html {
my @command = @base_command;
push @command, qw(t/tinypodcast), "$tmp/out";
+ ok(! system("rm -rf $tmp $statedir"), q{setup});
+
ok(! system("mkdir $tmp"),
q{setup});
ok(! system(@command),
my @command = (@base_command, qw(--plugin inline));
push @command, qw(t/tinypodcast), "$tmp/out";
+ ok(! system("rm -rf $tmp $statedir"), q{setup});
+
ok(! system("mkdir $tmp"),
q{setup});
ok(! system(@command),
single_page_html();
inlined_pages_html();
podcast('fancy');
+
+done_testing;
use warnings;
use strict;
-use Test::More tests => 24;
+use Test::More;
BEGIN { use_ok("IkiWiki"); }
BEGIN { use_ok("IkiWiki::Render"); }
is_deeply(\%pages, {});
is_deeply(\@del, ['tags/primes.mdwn']);
-
-# cleanup
-ok(! system("rm -rf t/tmp"));
-
-1;
+done_testing;
check_no_trail("untrail/a.html");
check_no_trail("untrail/b.html");
-ok(! system("rm -rf t/tmp"));
-
done_testing();
--templatedir=templates));
}
+ok(! system("rm -rf t/tmp"));
+
writefile("test.setup", "t/tmp", <<EOF
# IkiWiki::Setup::Yaml - YAML formatted setup file
wikiname: this is the name of my wiki