]> Sergey Matveev's repositories - public-inbox.git/blob - t/lei-oneshot.t
update copyrights for 2021
[public-inbox.git] / t / lei-oneshot.t
1 #!perl -w
2 # Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 use strict;
5 use v5.10.1;
6 use PublicInbox::TestCommon;
7 $PublicInbox::TestCommon::cached_scripts{'lei-oneshot'} //= do {
8         eval <<'EOF';
9 package LeiOneshot;
10 use strict;
11 use subs qw(exit);
12 *exit = \&PublicInbox::TestCommon::run_script_exit;
13 sub main {
14 # the below "line" directive is a magic comment, see perlsyn(1) manpage
15 # line 1 "lei-oneshot"
16         require PublicInbox::LEI;
17         PublicInbox::LEI::oneshot(__PACKAGE__);
18         0;
19 }
20 1;
21 EOF
22         LeiOneshot->can('main');
23 };
24 local $ENV{TEST_LEI_ONESHOT} = '1';
25 require './t/lei.t';