2 # Copyright (C) all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
5 use PublicInbox::TestCommon;
6 use PublicInbox::Config; # this relies on PI_CONFIG // ~/.public-inbox/config
7 my @psgi = qw(HTTP::Request::Common Plack::Test URI::Escape Plack::Builder);
8 require_mods(qw(DBD::SQLite Search::Xapian), @psgi);
10 use_ok 'PublicInbox::WWW';
11 my $cfg = PublicInbox::Config->new;
12 my $www = PublicInbox::WWW->new($cfg);
15 $env->{'psgi.errors'} = \*STDERR;
19 # TODO: convert these to self-contained test cases
22 '9e9048b02bd04d287461543d85db0bb715b89f8c'
23 .'/s/?b=t%2Ft3420%2Fremove-ids.sed',
24 'eebf7a8/s/?b=t%2Ftest-lib.sh',
25 'eb580ca513/s/?b=remote-odb.c',
26 '776fa90f7f/s/?b=contrib/git-jump/git-jump',
27 '5cd8845/s/?b=submodule.c',
28 '81c1164ae5/s/?b=builtin/log.c',
29 '6aa8857a11/s/?b=protocol.c',
30 '96f1c7f/s/', # TODO: b=contrib/completion/git-completion.bash
31 'b76f2c0/s/?b=po/zh_CN.po',
32 'c2f3bf071ee90b01f2d629921bb04c4f798f02fa/s/', # tag
36 my ($ibx_name, $urls, @gone);
40 my $url = "/$ibx_name/$_";
41 my $res = $cb->(GET($url));
42 is($res->code, 200, $url);
43 next if $res->code == 200;
50 while (($ibx_name, $urls) = each %$todo) {
52 my $ibx = $cfg->lookup_name($ibx_name);
54 push @gone, $ibx_name;
55 skip(qq{[publicinbox "$ibx_name"] not configured},
58 if (!defined($ibx->{coderepo})) {
59 push @gone, $ibx_name;
60 skip(qq{publicinbox.$ibx_name.coderepo not configured},
63 test_psgi($app, $client);
69 my $env = { PI_CONFIG => PublicInbox::Config->default_file };
70 while (($ibx_name, $urls) = each %$todo) {
71 test_httpd($env, $client, $nr);