blib/lib/Test/Smoke/App/Options.pm

filter: Statementstmt 68.1% 186 / 273 Branchbran 28.5% 4 / 14 Conditioncond 50.0% 6 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 59.0% 101 / 171 Podpod 0.0% 0 / 104 totaltotal 51.0% 297 / 582 CC 23 SCAR 7.7
CC
23
Cov
66%
smokeperl_config
9.2
perl5lib
6.0
perl5opt
6.0
CRAP 2.2
« lib/Test/Smoke/LogMixin.pm ↑ Summary blib/lib/Test/Smoke/App/AppOptionCollection.pm »
1 package Test::Smoke::App::Options;
2 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 10 our $VERSION = '0.002';
6  
7 10 ▶use Test::Smoke::App::AppOption;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 =head1 NAME
10  
11 Test::Smoke::App::Options - A collection of application configs and config
12 options.
13  
14 =cut
15  
16 10 my $opt = 'Test::Smoke::App::AppOption';
17  
18 5 ▶sub synctree_config { # synctree.pl
Subroutine synctree_config: called CC=1 SCAR=0.0
Pod undocumented
19 return (
20 5 main_options => [
21 sync_type(),
22 ],
23 general_options => [
24 ddir(),
25 ],
26 special_options => {
27 git => [
28 gitbin(),
29 gitorigin(),
30 gitdir(),
31 gitbare(),
32 gitdfbranch(),
33 gitbranchfile(),
34 ],
35 rsync => [
36 rsyncbin(),
37 rsyncopts(),
38 rsyncsource(),
39 ],
40 copy => [
41 cdir()
42 ],
43 fsync => [
44 fdir(),
45 ],
46 ftp => [
47 ftphost(),
48 ftpport(),
49 ],
50 snapshot => [
51 snapurl(),
52 snaptar(),
53 ],
54 },
55 );
56 }
57  
58 4 ▶sub mailer_config { # mailing reports
Subroutine mailer_config: called CC=1 SCAR=0.0
Pod undocumented
59 return (
60 4 main_options => [
61 mail_type(),
62 ],
63 general_options => [
64 ddir(),
65 to(),
66 cc(),
67 bcc(),
68 ccp5p_onfail(),
69 rptfile(),
70 mail(),
71 report(0),
72 ],
73 special_options => {
74 mail => [ mailbin() ],
75 mailx => [
76 mailxbin(),
77 swcc(),
78 swbcc(),
79 ],
80 sendemail => [
81 sendemailbin(),
82 from(),
83 mserver(),
84 msport(),
85 msuser(),
86 mspass(),
87 ],
88 sendmail => [
89 sendmailbin(),
90 from(),
91 ],
92 'Mail::Sendmail' => [
93 from(),
94 mserver(),
95 msport(),
96 ],
97 'MIME::Lite' => [
98 from(),
99 mserver(),
100 msport(),
101 msuser(),
102 mspass(),
103 ],
104 },
105 );
106 }
107  
108 9 ▶sub poster_config { # posting to CoreSmokeDB
Subroutine poster_config: called CC=1 SCAR=0.0
Pod undocumented
109 return (
110 9 main_options => [
111 poster(),
112 ],
113 general_options => [
114 ddir(),
115 smokedb_url(),
116 jsnfile(),
117 qfile(),
118 report(0),
119 ],
120 special_options => {
121 'LWP::UserAgent' => [
122 ua_timeout(),
123 ],
124 'HTTP::Tiny' => [
125 ua_timeout(),
126 ],
127 'curl' => [
128 curlbin(),
129 curlargs(),
130 ua_timeout(),
131 ],
132 },
133 );
134 }
135  
136 6 ▶sub reporter_config { # needed for sending out reports
Subroutine reporter_config: called CC=1 SCAR=0.0
Pod undocumented
137 return (
138 6 general_options => [
139 ddir(),
140 outfile(),
141 rptfile(),
142 jsnfile(),
143 lfile(),
144 cfg(),
145 showcfg(),
146 locale(),
147 defaultenv(),
148 perlio_only(),
149 is56x(),
150 skip_tests(),
151 harnessonly(),
152 harness3opts(),
153 hostname(),
154 from(),
155 send_log(),
156 send_out(),
157 user_note(),
158 un_file(),
159 un_position(),
160 ],
161 );
162 }
163  
164 3 ▶sub reposter_config {
Subroutine reposter_config: called CC=1 SCAR=0.0
Pod undocumented
165 3 my %pc = poster_config();
166 3 my $pc_so = $pc{special_options};
167 return (
168 3 main_options => [
169 poster(),
170 ],
171 general_options => [
172 adir(),
173 commit_sha(),
174 jsonreport(),
175 max_reports(),
176 smokedb_url(),
177 ],
178 special_options => $pc_so,
179 );
180 }
181  
182 4 ▶sub sendreport_config { # sendreport.pl
Subroutine sendreport_config: called CC=5 SCAR=16.1
Pod undocumented
183 # merge: mailer_config, poster_config and reporter_config.
184 4 my %mc = mailer_config();
185 4 my %pc = poster_config();
186 4 my %rc = reporter_config();
187 4 my %g_o;
188 4 for my $opt ( @{$mc{general_options}}
189 4 , @{$pc{general_options}}
190 4 , @{$rc{general_options}})
191 {
192 136 ▶ $g_o{$opt->name} ||= $opt;
Condition66%2/3
$g_o{$opt->name} ||= $opt
l!l&&r!l&&!r
201160
MC/DC0%0/2
$g_o{$opt->name} ||= $opt
$g_o{$opt->name} $opt
Truth table66%2/3
A ||= B
A= $g_o{$opt->name}B= $opt
ABresult
1X1
011
000
193 }
194 4 my %s_o;
195 4 for my $so (keys %{$mc{special_options}}) {
196 24 $s_o{$so} = $mc{special_options}{$so};
197 }
198 4 for my $so (keys %{$pc{special_options}}) {
199 12 $s_o{$so} = $pc{special_options}{$so};
200 }
201  
202 return (
203 4 main_options => [mail_type(), poster() ],
204 general_options => [values %g_o, report(0)],
205 special_options => \%s_o,
206 );
207 }
208  
209 7 ▶sub runsmoke_config { # runsmoke.pl
Subroutine runsmoke_config: called CC=1 SCAR=0.0
Pod undocumented
210 return (
211 7 general_options => [
212 ddir(),
213 outfile(),
214 rptfile(),
215 jsnfile(),
216 cfg(),
217 defaultenv(),
218 perlio_only(),
219 force_c_locale(),
220 harness3opts(),
221 harnessonly(),
222 hasharness3(),
223 is56x(),
224 is_vms(),
225 is_win32(),
226 killtime(),
227 locale(),
228 makeopt(),
229 opt_continue(),
230 skip_tests(),
231 testmake(),
232 w32args(),
233 w32cc(),
234 w32make(),
235 pass_option(),
236 ],
237 );
238 }
239  
240 5 ▶sub archiver_config {
Subroutine archiver_config: called CC=1 SCAR=0.0
Pod undocumented
241 return (
242 5 general_options => [
243 archive(),
244 ddir(),
245 adir(),
246 outfile(),
247 rptfile(),
248 jsnfile(),
249 lfile(),
250 ],
251 );
252 }
253  
254 2 ▶sub smokeperl_config {
Subroutine smokeperl_config: called CC=9 SCAR=22.1
Pod undocumented
255 2 my %stc = synctree_config();
256 2 my %rsc = runsmoke_config();
257 2 my %arc = archiver_config();
258 2 my %src = sendreport_config();
259  
260 2 my %m_o;
261 2 for my $opt (@{$stc{main_options}}, @{$rsc{main_options}},
262 2 @{$arc{main_options}}, @{$src{main_options}})
263 {
264 6 ▶ $m_o{$opt->name} ||= $opt;
Condition33%1/3
$m_o{$opt->name} ||= $opt
l!l&&r!l&&!r
060
MC/DC0%0/2
$m_o{$opt->name} ||= $opt
$m_o{$opt->name} $opt
Truth table33%1/3
A ||= B
A= $m_o{$opt->name}B= $opt
ABresult
1X1
011
000
265 }
266 2 my %g_o = (
267 sync()->name => sync(),
268 report()->name => report(),
269 sendreport()->name => sendreport(),
270 archive()->name => archive(),
271 smartsmoke()->name => smartsmoke(),
272 patchlevel()->name => patchlevel(),
273 );
274 2 for my $opt (@{$stc{general_options}}, @{$rsc{general_options}},
275 2 @{$arc{general_options}}, @{$src{general_options}})
276 {
277 124 ▶ $g_o{$opt->name} ||= $opt;
Condition66%2/3
$g_o{$opt->name} ||= $opt
l!l&&r!l&&!r
42820
MC/DC0%0/2
$g_o{$opt->name} ||= $opt
$g_o{$opt->name} $opt
Truth table66%2/3
A ||= B
A= $g_o{$opt->name}B= $opt
ABresult
1X1
011
000
278 }
279 2 my %s_o;
280 2 for my $so (keys %{$stc{special_options}}) {
281 12 $s_o{$so} = $stc{special_options}{$so};
282 }
283 2 for my $so (keys %{$rsc{special_options}}) {
284 0 $s_o{$so} = $rsc{special_options}{$so};
285 }
286 2 for my $so (keys %{$arc{special_options}}) {
287 0 $s_o{$so} = $arc{special_options}{$so};
288 }
289 2 for my $so (keys %{$src{special_options}}) {
290 18 $s_o{$so} = $src{special_options}{$so};
291 }
292  
293 return (
294 6 main_options => [sort { $a->name cmp $b->name } values %m_o],
295 2 general_options => [sort { $a->name cmp $b->name } values %g_o],
296 special_options => { %s_o },
297 );
298 }
299  
300 0 ▶sub w32configure_config {
Subroutine w32configure_config: not called CC=1 SCAR=6.9
Pod undocumented
301 return (
302 0 general_options => [
303 ddir(),
304 w32cc(),
305 w32make(),
306 w32args(),
307 ],
308 );
309 }
310  
311 0 ▶sub configsmoke_config {
Subroutine configsmoke_config: not called CC=1 SCAR=6.9
Pod undocumented
312 return (
313 0 general_options => [
314 minus_des()
315 ]
316 );
317 }
318  
319 0 ▶sub smokestatus_config {
Subroutine smokestatus_config: not called CC=1 SCAR=6.9
Pod undocumented
320 return (
321 0 general_options => [
322 ddir(),
323 outfile(),
324 cfg(),
325 ],
326 );
327 }
328  
329 2 ▶sub handlequeue_config {
Subroutine handlequeue_config: called CC=1 SCAR=0.0
Pod undocumented
330 2 my %pc = poster_config();
331 2 my $pc_so = $pc{special_options};
332 return (
333 2 main_options => [ poster() ],
334 general_options => [
335 adir(),
336 smokedb_url(),
337 qfile(),
338 ],
339 special_options => $pc_so,
340 );
341 }
342  
343 ###########################################################
344 ##### Individual options #####
345 ###########################################################
346  
347 10 ▶sub adir {
Subroutine adir: called CC=1 SCAR=3.5
Pod undocumented
348 return $opt->new(
349 name => 'adir',
350 option => '=s',
351 default => '',
352 helptext => "Directory to archive the smoker files in.",
353 configtext => "Which directory should be used for the archives?
354 \t(Make empty for no archiving)",
355 configtype => 'prompt_dir',
356 0 ▶ configdft => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
357 0 my $app = shift;
358 0 require File::Spec;
359 0 File::Spec->catdir('logs', $app->prefix);
360 },
361 10 );
362 }
363  
364 9 ▶sub archive {
Subroutine archive: called CC=1 SCAR=0.0
Pod undocumented
365 9 return $opt->new(
366 name => 'archive',
367 option => '!',
368 default => 1,
369 helptext => "Archive the reports after smoking.",
370 );
371 }
372  
373 4 ▶sub bcc {
Subroutine bcc: called CC=1 SCAR=1.2
Pod undocumented
374 return $opt->new(
375 name => 'bcc',
376 option => '=s',
377 default => '',
378 helptext => 'Where to send a bcc of the reports.',
379 allow => [ undef, '', qr/@/ ],
380 configtype => 'prompt',
381 configtext => 'This is the email address used to send BlindCarbonCopy:',
382 0 ▶ configdft => sub {''},
Subroutine __ANON__: not called CC=1 SCAR=6.9
383 4 );
384 }
385  
386 4 ▶sub cc {
Subroutine cc: called CC=1 SCAR=1.2
Pod undocumented
387 return $opt->new(
388 name => 'cc',
389 option => '=s',
390 default => '',
391 helptext => 'Where to send a cc of the reports.',
392 allow => [ undef, '', qr/@/ ],
393 configtype => 'prompt',
394 configtext => 'This is the email address used to send CarbonCopy:',
395 0 ▶ configdft => sub {''},
Subroutine __ANON__: not called CC=1 SCAR=6.9
396 4 );
397 }
398  
399 4 ▶sub ccp5p_onfail {
Subroutine ccp5p_onfail: called CC=1 SCAR=0.0
Pod undocumented
400 4 return $opt->new(
401 name => 'ccp5p_onfail',
402 option => '!',
403 default => 0,
404 helptext => 'Include the p5p-mailinglist in CC.',
405 );
406 }
407  
408 5 ▶sub cdir { # cdir => ddir
Subroutine cdir: called CC=1 SCAR=0.0
Pod undocumented
409 5 return $opt->new(
410 name => 'cdir',
411 option => '=s',
412 helptext => "The local directory from where to copy the perlsources.",
413 );
414 }
415  
416 13 ▶sub cfg {
Subroutine cfg: called CC=1 SCAR=0.4
Pod undocumented
417 return $opt->new(
418 name => 'cfg',
419 option => '=s',
420 default => undef,
421 helptext => "The name of the BuildCFG file.",
422 configtext => "Which build configurations file would you like to use?",
423 configtype => 'prompt_file',
424 configfnex => 1,
425 0 ▶ configdft => sub {
Subroutine __ANON__: not called CC=1 SCAR=0.6
426 0 my $self = shift;
427 10 ▶ use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
428 0 File::Spec->rel2abs($self->prefix . ".buildcfg");
429 },
430 13 );
431 }
432  
433 3 ▶sub commit_sha {
Subroutine commit_sha: called CC=1 SCAR=0.2
Pod undocumented
434 return $opt->new(
435 name => 'commit_sha',
436 option => 'sha=s@',
437 3 ▶ allow => sub {
Subroutine __ANON__: called CC=3 SCAR=11.7
438 3 my $values = shift;
439 3 my $ok = 1;
440 3 ▶ $ok &&= m{^ [0-9a-f]+ $}x for @$values;
Condition33%1/3
$ok &&= /^ [0-9a-f]+ $/x
!ll&&!rl&&r
005
MC/DC0%0/2
$ok &&= /^ [0-9a-f]+ $/x
$ok /^ [0-9a-f]+ $/x
Truth table33%1/3
A &&= B
A= $okB= /^ [0-9a-f]+ $/x
ABresult
0X0
100
111
441 3 return $ok;
442 },
443 3 default => [ ],
444 helptext => "A (partial) commit SHA (repeatable!)",
445 );
446 }
447  
448 9 ▶sub curlargs {
Subroutine curlargs: called CC=1 SCAR=0.0
Pod undocumented
449 9 return $opt->new(
450 name => 'curlargs',
451 option => '=s@',
452 default => [ ],
453 helptext => "Extra switches to pass to curl (repeatable!)",
454 );
455 }
456  
457 9 ▶sub curlbin {
Subroutine curlbin: called CC=1 SCAR=1.2
Pod undocumented
458 return $opt->new(
459 name => 'curlbin',
460 option => '=s',
461 default => 'curl',
462 helptext => "The fqp for the curl program.",
463 configtext => "Which 'curl' binary do you want to use?",
464 0 ▶ configdft => sub { (_helper(whereis => ['curl'])->())->[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
465 9 configord => 3,
466 );
467 }
468  
469 36 ▶sub ddir {
Subroutine ddir: called CC=1 SCAR=0.1
Pod undocumented
470 return $opt->new(
471 name => 'ddir',
472 option => 'd=s',
473 helptext => 'Directory where perl is smoked.',
474 configtext => "Where would you like the new source-tree?",
475 configtype => 'prompt_dir',
476 0 ▶ configdft => sub {
Subroutine __ANON__: not called CC=1 SCAR=0.2
477 10 ▶ use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
478 0 File::Spec->catdir(File::Spec->rel2abs(File::Spec->updir), 'perl-current');
479 },
480 36 );
481 }
482  
483 13 ▶sub defaultenv {
Subroutine defaultenv: called CC=1 SCAR=2.6
Pod undocumented
484 return $opt->new(
485 name => 'defaultenv',
486 option => '!',
487 default => 0,
488 helptext => "Do not set the test suite environment to locale.",
489 configtext => "Run the test suite without \$ENV{PERLIO}?",
490 configtype => 'prompt_yn',
491 0 ▶ configalt => sub { [qw/ N y /] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
492 0 ▶ configdft => sub {'n'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
493 13 );
494 }
495  
496 5 ▶sub fdir { # mdir => fdir => ddir
Subroutine fdir: called CC=1 SCAR=0.0
Pod undocumented
497 5 return $opt->new(
498 name => 'fdir',
499 option => '=s',
500 helptext => "The local directory to build the hardlink Forest from.",
501 );
502 }
503  
504 22 ▶sub from {
Subroutine from: called CC=1 SCAR=1.2
Pod undocumented
505 return $opt->new(
506 name => 'from',
507 option => '=s',
508 default => '',
509 allow => [ '', qr/@/ ],
510 helptext => 'Where to send the reports from.',
511 configtype => 'prompt',
512 configtext => 'This is the email address used to send FROM:',
513 0 ▶ configdft => sub {''},
Subroutine __ANON__: not called CC=1 SCAR=6.9
514 22 );
515 }
516  
517 0 ▶sub fsync { # How to sync the mdir for Forest.
Subroutine fsync: not called CC=1 SCAR=6.9
Pod undocumented
518 0 my $s = sync_type();
519 0 $s->name('fsync');
520 0 return $s;
521 }
522  
523 7 ▶sub force_c_locale {
Subroutine force_c_locale: called CC=1 SCAR=2.6
Pod undocumented
524 return $opt->new(
525 name => 'force_c_locale',
526 default => 0,
527 helptext => "Run test suite under the C locale only.",
528 configtext => "Should \$ENV{LC_ALL} be forced to 'C'?",
529 configtype => 'prompt_yn',
530 0 ▶ configalt => sub { [qw/ N y /] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
531 0 ▶ configdft => sub {'n'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
532 7 );
533 }
534  
535 5 ▶sub ftphost {
Subroutine ftphost: called CC=1 SCAR=1.2
Pod undocumented
536 return $opt->new(
537 name => 'ftphost',
538 option => '=s',
539 default => 'ftp.example.com',
540 helptext => "The FTP server",
541 configtext => "What is the URL of your FTP server?",
542 0 ▶ configalt => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
543 5 configord => 1,
544 );
545 }
546  
547 5 ▶sub ftpport {
Subroutine ftpport: called CC=1 SCAR=1.2
Pod undocumented
548 return $opt->new(
549 name => 'ftpport',
550 option => '=i',
551 default => 21,
552 helptext => "The FTP port",
553 configtext => "What is the port of your FTP server?",
554 0 ▶ configalt => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
555 5 configord => 2,
556 );
557 }
558  
559 5 ▶sub snapurl {
Subroutine snapurl: called CC=1 SCAR=0.4
Pod undocumented
560 5 my $blead = "https://github.com/Perl/perl5/archive/refs/heads/blead.tar.gz";
561 #my $tag = "https://github.com/Perl/perl5/archive/refs/tags/v5.41.6.tar.gz";
562 #my $pr_domestic = "https://github.com/Perl/perl5/archive/refs/pull/22991/head.tar.gz";
563 #my $pr_from_fork = "https://github.com/Perl/perl5/archive/refs/pull/22981/head.tar.gz";
564 return $opt->new(
565 name => 'snapurl',
566 option => '=s',
567 default => "$blead",
568 helptext => "The URL with path",
569 configtext => "What is the URL of the delivery?",
570 0 ▶ configalt => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
571 5 configord => 1,
572 );
573 }
574  
575 5 ▶sub snaptar {
Subroutine snaptar: called CC=1 SCAR=1.2
Pod undocumented
576 return $opt->new(
577 name => 'snaptar',
578 option => '=s',
579 default => '',
580 helptext => "The tar/zip command to unarchive",
581 configtext => "What is the tar/zip command to use to unarchive the delivery?",
582 0 ▶ configalt => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
583 5 configord => 1,
584 );
585 }
586  
587 5 ▶sub gitbin {
Subroutine gitbin: called CC=1 SCAR=1.2
Pod undocumented
588 return $opt->new(
589 name => 'gitbin',
590 option => '=s',
591 default => 'git',
592 helptext => "The name of the 'git' program.",
593 configtext => "Which 'git' binary do you want to use?",
594 configtype => 'prompt_file',
595 0 ▶ configdft => sub { (_helper(whereis => ['git'])->())->[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
596 5 configord => 1,
597 );
598 }
599  
600 5 ▶sub gitorigin {
Subroutine gitorigin: called CC=1 SCAR=1.2
Pod undocumented
601 return $opt->new(
602 name => 'gitorigin',
603 option => '=s',
604 default => 'https://github.com/Perl/perl5.git',
605 helptext => "The remote location of the git repository.",
606 configtext => "Where is your main Git repository?",
607 0 ▶ configalt => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
608 5 configord => 2,
609 );
610 }
611  
612 5 ▶sub gitdir {
Subroutine gitdir: called CC=1 SCAR=0.4
Pod undocumented
613 return $opt->new(
614 name => 'gitdir',
615 option => '=s',
616 default => 'perl-from-github',
617 helptext => "The local directory of the git repository.",
618 configtext => "Where do I put the main Git repository?",
619 configtype => 'prompt_dir',
620 0 ▶ configalt => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
621 0 ▶ configdft => sub {
Subroutine __ANON__: not called CC=1 SCAR=0.2
622 10 ▶ use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
623 0 File::Spec->catfile(
624 File::Spec->rel2abs(File::Spec->updir),
625 'perl-from-github'
626 );
627 },
628 5 configord => 3,
629 );
630 }
631  
632 5 ▶sub gitbare {
Subroutine gitbare: called CC=1 SCAR=2.6
Pod undocumented
633 return $opt->new(
634 name => 'gitbare',
635 option => '!',
636 default => 0,
637 helptext => "Clone as a bare repository",
638 configtext => "Clone bare git repository?",
639 configtype => 'prompt_yn',
640 0 ▶ configalt => sub { [qw/ y N /] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
641 0 ▶ configdft => sub {'n'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
642 5 );
643 }
644  
645  
646  
647 5 ▶sub gitdfbranch {
Subroutine gitdfbranch: called CC=1 SCAR=1.2
Pod undocumented
648 return $opt->new(
649 name => 'gitdfbranch',
650 option => '=s',
651 default => 'blead',
652 helptext => "The name of the gitbranch you smoke.",
653 configtext => "Which branch should be smoked by default?",
654 configtype => 'prompt',
655 0 ▶ configalt => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
656 5 configord => 4,
657 );
658 }
659  
660 5 ▶sub gitbranchfile {
Subroutine gitbranchfile: called CC=1 SCAR=3.5
Pod undocumented
661 return $opt->new(
662 name => 'gitbranchfile',
663 option => '=s',
664 default => '',
665 helptext => "The name of the file where the gitbranch is stored.",
666 configtext => "File name to put branch name for smoking in?",
667 configtype => 'prompt_file',
668 0 ▶ configalt => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
669 0 ▶ configdft => sub { my $self = shift; return $self->prefix . ".gitbranch" },
Subroutine __ANON__: not called CC=1 SCAR=6.9
670 5 configfnex => 1,
671 configord => 5,
672 );
673 }
674  
675 0 ▶sub harness_destruct {
Subroutine harness_destruct: not called CC=1 SCAR=6.9
Pod undocumented
676 0 return $opt->new(
677 name => 'harness_destruct',
678 option => 'harness-destruct=i',
679 default => 2,
680 helptext => "Sets \$ENV{PERL_DESTRUCT_LEVEL} for 'make test_harness'.",
681 );
682 }
683  
684 13 ▶sub harness3opts {
Subroutine harness3opts: called CC=1 SCAR=1.2
Pod undocumented
685 return $opt->new(
686 name => 'harness3opts',
687 option => '=s',
688 default => '',
689 helptext => "Extra options to pass to harness v3+.",
690 configtext => "Extra options for Test::Harness 3
691 \tFor parallel testing use; 'j5'",
692 0 ▶ configdft => sub {''},
Subroutine __ANON__: not called CC=1 SCAR=6.9
693 13 );
694 }
695  
696 13 ▶sub harnessonly {
Subroutine harnessonly: called CC=1 SCAR=2.6
Pod undocumented
697 return $opt->new(
698 name => 'harnessonly',
699 option => '!',
700 default => 0,
701 helptext => "Run test suite as 'make test_harness' (not make test).",
702 configtext => "Use harness only (skip TEST)?",
703 configtype => 'prompt_yn',
704 0 ▶ configalt => sub { [qw/ y N /] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
705 0 ▶ configdft => sub {'n'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
706 13 );
707 }
708  
709 7 ▶sub hasharness3 {
Subroutine hasharness3: called CC=1 SCAR=0.0
Pod undocumented
710 7 return $opt->new(
711 name => 'hasharness3',
712 option => '=i',
713 default => 1,
714 helptext => "Internal option for Test::Smoke::Smoker.",
715 );
716 }
717  
718 0 ▶sub hdir { # hdir => ddir
Subroutine hdir: not called CC=1 SCAR=6.9
Pod undocumented
719 0 return $opt->new(
720 name => 'hdir',
721 option => '=s',
722 helptext => "The local directory to hardlink from.",
723 );
724 }
725  
726 6 ▶sub hostname {
Subroutine hostname: called CC=1 SCAR=0.0
Pod undocumented
727 10 ▶ use System::Info;
Subroutine BEGIN: called CC=1 SCAR=0.0
728 6 my $hostname = System::Info::si_uname('n');
729 6 return $opt->new(
730 name => 'hostname',
731 option => '=s',
732 default => $hostname,
733 helptext => 'Use the hostname option to override System::Info->hostname',
734 configtext => "Use this option to override the default hostname.
735 \tLeave empty for default ($hostname)",
736 );
737 }
738  
739 13 ▶sub is56x {
Subroutine is56x: called CC=1 SCAR=0.0
Pod undocumented
740 13 return $opt->new(
741 name => 'is56x',
742 option => '!',
743 helptext => "Are we smoking perl maint-5.6?",
744 );
745 }
746  
747 7 ▶sub is_vms {
Subroutine is_vms: called CC=1 SCAR=0.0
Pod undocumented
748 7 return $opt->new(
749 name => 'is_vms',
750 default => ($^O eq 'VMS'),
751 helptext => "Internal, shows we're on VMS",
752 );
753 }
754  
755 7 ▶sub is_win32 {
Subroutine is_win32: called CC=1 SCAR=0.0
Pod undocumented
756 7 return $opt->new(
757 name => 'is_win32',
758 default => ($^O eq 'MSWin32'),
759 helptext => "Internal, shows we're on MSWin32",
760 );
761 }
762  
763 27 ▶sub jsnfile {
Subroutine jsnfile: called CC=1 SCAR=0.0
Pod undocumented
764 27 return $opt->new(
765 name => 'jsnfile',
766 option => '=s',
767 default => 'mktest.jsn',
768 helptext => 'Name of the file to store the JSON report in.',
769 );
770 }
771  
772 3 ▶sub jsonreport {
Subroutine jsonreport: called CC=1 SCAR=0.0
Pod undocumented
773 3 return $opt->new(
774 name => 'jsonreport',
775 option => '=s',
776 default => undef,
777 helptext => "Name of json report file to re-post to the server"
778 . " (Takes precedence over '--adir' and '--sha')",
779 );
780 }
781  
782 7 ▶sub killtime {
Subroutine killtime: called CC=1 SCAR=1.2
Pod undocumented
783 return $opt->new(
784 name => 'killtime',
785 option => '=s',
786 default => '',
787 allow => [undef, '', qr/^\+?[0-9]{1,2}:[0-9]{2}$/],
788 helptext => "The absolute or relative time the smoke may run.",
789 configtext => <<"EOT",
790 Should this smoke be aborted on/after a specific time?
791 \tuse HH:MM to specify a point in time (24 hour notation)
792 \tuse +HH:MM to specify a duration
793 \tleave empty to finish the smoke without aborting
794 EOT
795 0 ▶ configdft => sub { "" },
Subroutine __ANON__: not called CC=1 SCAR=6.9
796 7 );
797 }
798  
799 11 ▶sub lfile {
Subroutine lfile: called CC=1 SCAR=0.0
Pod undocumented
800 11 return $opt->new(
801 name => 'lfile',
802 option => '=s',
803 default => '',
804 helptext => 'Name of the file to store the smoke log in.',
805 );
806 }
807  
808 13 ▶sub locale {
Subroutine locale: called CC=1 SCAR=0.0
Pod undocumented
809 13 return $opt->new(
810 name => 'locale',
811 option => '=s',
812 default => '',
813 allow => [undef, '', qr{utf-?8$}i],
814 helptext => "Choose a locale to run the test suite under.",
815 configtext => "What locale should be used for extra testing?
816 \t(Leave empty for none)",
817 );
818 }
819  
820 4 ▶sub mail {
Subroutine mail: called CC=1 SCAR=2.6
Pod undocumented
821 return $opt->new(
822 name => 'mail',
823 option => '!',
824 allow => [ 0, 1 ],
825 default => 0,
826 helptext => "Send report via mail.",
827 configtext => 'The existence of the mailing-list is not guarenteed',
828 configtype => 'prompt_yn',
829 0 ▶ configalt => sub { [qw/ y N /] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
830 0 ▶ configdft => sub {'n'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
831 4 );
832 }
833  
834 8 ▶sub mail_type {
Subroutine mail_type: called CC=1 SCAR=1.2
Pod undocumented
835 my $mail_type = $opt->new(
836 name => 'mail_type',
837 option => 'mailer=s',
838 allow => [qw/sendmail mail mailx sendemail Mail::Sendmail MIME::Lite/],
839 default => 'Mail::Sendmail',
840 helptext => "The type of mailsystem to use.",
841 configalt => _helper('get_avail_mailers'),
842 0 ▶ configdft => sub { (_helper('get_avail_mailers')->())[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
843 8 );
844 }
845  
846 4 ▶sub mailbin {
Subroutine mailbin: called CC=1 SCAR=1.2
Pod undocumented
847 return $opt->new(
848 name => 'mailbin',
849 option => '=s',
850 default => 'mail',
851 helptext => "The name of the 'mail' program.",
852 configtext => 'The fully qualified name of the executable.',
853 0 ▶ configdft => sub { (_helper(whereis => ['mail'])->())->[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
854 4 );
855 }
856  
857 4 ▶sub mailxbin {
Subroutine mailxbin: called CC=1 SCAR=1.2
Pod undocumented
858 return $opt->new(
859 name => 'mailxbin',
860 option => '=s',
861 default => 'mailx',
862 helptext => "The name of the 'mailx' program.",
863 configtext => 'The fully qualified name of the executable.',
864 0 ▶ configdft => sub { (_helper(whereis => ['mailx'])->())->[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
865 4 );
866 }
867  
868 7 ▶sub makeopt {
Subroutine makeopt: called CC=1 SCAR=0.4
Pod undocumented
869 7 require Config;
870 return $opt->new(
871 name => 'makeopt',
872 option => '=s',
873 default => '',
874 helptext => "Extra option to pass to make.",
875 configtext => "Specify extra arguments for '$Config::Config{make}'\n"
876 . "\t(for the 'build' and 'test_prep' steps)",
877 0 ▶ configdft => sub { '' },
Subroutine __ANON__: not called CC=1 SCAR=6.9
878 7 );
879 }
880  
881 3 ▶sub max_reports {
Subroutine max_reports: called CC=1 SCAR=0.0
Pod undocumented
882 3 return $opt->new(
883 name => 'max_reports',
884 option => 'max-reports|max=i',
885 default => 10,
886 helptext => "Maximum number of reports to pick from",
887 );
888 }
889  
890 0 ▶sub mdir { # mdir => fdir => ddir
Subroutine mdir: not called CC=1 SCAR=6.9
Pod undocumented
891 0 return $opt->new(
892 name => 'mdir',
893 option => '=s',
894 helptext => "The master directory of the Hardlink-Forest.",
895 );
896 }
897  
898 0 ▶sub minus_des {
Subroutine minus_des: not called CC=1 SCAR=6.9
Pod undocumented
899 0 return $opt->new(
900 name => 'des',
901 option => 'usedft',
902 helptext => "Use all the default values.",
903 );
904 }
905  
906 8 ▶sub mspass {
Subroutine mspass: called CC=1 SCAR=0.0
Pod undocumented
907 8 return $opt->new(
908 name => 'mspass',
909 option => '=s',
910 helptext => 'Password for <msuser> for SMTP server.',
911 configtext => "Type the password: 'noecho' but plain-text in config file!",
912 configtype => 'prompt_noecho',
913 );
914 }
915  
916 12 ▶sub msport {
Subroutine msport: called CC=1 SCAR=0.0
Pod undocumented
917 12 return $opt->new(
918 name => 'msport',
919 option => '=i',
920 default => 25,
921 helptext => 'Which port for SMTP server to send reports.',
922 configtext => "Some SMTP servers use port 465 or 587",
923 );
924 }
925  
926 8 ▶sub msuser {
Subroutine msuser: called CC=1 SCAR=0.0
Pod undocumented
927 8 return $opt->new(
928 name => 'msuser',
929 option => '=s',
930 default => undef,
931 allow => [ undef, '', qr/\w+/ ],
932 helptext => 'Username for SMTP server.',
933 configtext => "This is the username for logging into the SMTP server\n"
934 . " leave empty if you don't have to login",
935 );
936 }
937  
938 12 ▶sub mserver {
Subroutine mserver: called CC=1 SCAR=0.0
Pod undocumented
939 12 return $opt->new(
940 name => 'mserver',
941 option => '=s',
942 default => 'localhost',
943 helptext => 'Which SMTP server to send reports.',
944 configtext => "SMTP server to use for sending reports",
945 );
946 }
947  
948 7 ▶sub opt_continue {
Subroutine opt_continue: called CC=1 SCAR=0.0
Pod undocumented
949 7 return $opt->new(
950 name => 'continue',
951 option => '',
952 default => 0,
953 helptext => "Continue where last smoke left-off.",
954 );
955 }
956  
957 21 ▶sub outfile {
Subroutine outfile: called CC=1 SCAR=0.0
Pod undocumented
958 21 return $opt->new(
959 name => 'outfile',
960 option => '=s',
961 default => 'mktest.out',
962 helptext => 'Name of the file to store the raw smoke log in.',
963 );
964 }
965  
966 7 ▶sub pass_option {
Subroutine pass_option: called CC=1 SCAR=0.1
Pod undocumented
967 return $opt->new(
968 name => 'pass_option',
969 option => 'pass-option|p=s@',
970 default => [],
971 7 ▶ allow => sub {
Subroutine __ANON__: called CC=4 SCAR=14.3
972 7 my ($list) = @_;
973 7 ▶ return unless ref($list) eq 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $list eq "ARRAY" 0 7 7
974 7 for my $to_pass (@$list) {
975 2 ▶ return unless $to_pass =~ m{^ - [DUA] .+ $}x;
Branch: 1 branch
BranchTrueFalseTotal
unless $to_pass =~ /^ - [DUA] .+ $/x 0 2 2
976 }
977 7 return 1;
978 },
979 7 helptext => 'Pass these options to Configure.',
980 );
981 }
982  
983 4 ▶sub patchlevel {
Subroutine patchlevel: called CC=1 SCAR=0.0
Pod undocumented
984 4 return $opt->new(
985 name => 'patchlevel',
986 option => '=s',
987 helptext => "State the 'patchlevel' of the source-tree (for --nosync).",
988 );
989 }
990  
991 0 ▶sub perl_version {
Subroutine perl_version: not called CC=1 SCAR=6.9
Pod undocumented
992 0 return $opt->new(
993 name => 'perl_version',
994 option => '=s',
995 allow => qr{^ (?:blead | 5 [.] (?: [2][68] | [3-9][02468] ) [.] x+ ) $}x,
996 dft => 'blead',
997 );
998 }
999  
1000 0 ▶sub perl5lib {
Subroutine perl5lib: not called CC=2 SCAR=17.9
Pod undocumented
1001 return $opt->new(
1002 name => 'perl5lib',
1003 option => '=s',
1004 0 ▶ dft => exists($ENV{PERL5LIB}) ? $ENV{PERL5LIB} : '',
Branch: 1 branch
BranchTrueFalseTotal
exists $ENV{'PERL5LIB'} ? : 0 0 0
1005 helptext => "What value should be used for PERL5LIB in the jcl wrapper?\n",
1006 configtext => "\$PERL5LIB will be set to this value during the smoke\n"
1007 . "\t(Make empty, with single space, to not set it.)",
1008 );
1009 }
1010  
1011 0 ▶sub perl5opt {
Subroutine perl5opt: not called CC=2 SCAR=17.9
Pod undocumented
1012 return $opt->new(
1013 name => 'perl5opt',
1014 option => '=s',
1015 0 ▶ dft => exists($ENV{PERL5OPT}) ? $ENV{PERL5OPT} : '',
Branch: 1 branch
BranchTrueFalseTotal
exists $ENV{'PERL5OPT'} ? : 0 0 0
1016 helptext => "What value should be used for PERL5OPT in the jcl wrapper?\n",
1017 configtext => "\$PERL5OPT will be set to this value during the smoke\n"
1018 . "\t(Make empty, with single space, to not set it.)",
1019 );
1020 }
1021  
1022 13 ▶sub perlio_only {
Subroutine perlio_only: called CC=1 SCAR=2.6
Pod undocumented
1023 return $opt->new(
1024 name => 'perlio_only',
1025 option => '!',
1026 default => 0,
1027 helptext => "Do not set the test suite environment to stdio.",
1028 configtext => "Run the test suite without \$ENV{PERLIO}=='stdio'?",
1029 configtype => 'prompt_yn',
1030 0 ▶ configalt => sub { [qw/ Y n /] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1031 0 ▶ configdft => sub {'Y'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1032 13 );
1033 }
1034  
1035 18 ▶sub poster {
Subroutine poster: called CC=1 SCAR=1.2
Pod undocumented
1036 return $opt->new(
1037 name => 'poster',
1038 option => '=s',
1039 allow => [qw/HTTP::Tiny LWP::UserAgent curl/],
1040 default => 'HTTP::Tiny',
1041 helptext => "The type of HTTP post system to use.",
1042 configtext => "Which HTTP client do you want to use?",
1043 configalt => _helper('get_avail_posters'),
1044 0 ▶ configdft => sub { (_helper('get_avail_posters')->())[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1045 18 configord => 2,
1046 );
1047 }
1048  
1049 11 ▶sub qfile {
Subroutine qfile: called CC=1 SCAR=1.2
Pod undocumented
1050 return $opt->new(
1051 name => 'qfile',
1052 option => '=s',
1053 allow => [undef, '', qr{^[\w./:\\-]+$}],
1054 default => undef,
1055 helptext => 'The qfile keeps the queue of reports to resend.',
1056 configtext => "One can now queue reports if they couldn't be delivered.\n"
1057 . "\tLeave empty for no queue.",
1058 0 ▶ configdft => sub {undef},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1059 11 );
1060 }
1061  
1062 21 ▶sub report {
Subroutine report: called CC=2 SCAR=6.9
Pod undocumented
1063 21 ▶ my $default = @_ ? shift : 1;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 17 4 21
1064 21 return $opt->new(
1065 name => 'report',
1066 option => '!',
1067 default => $default,
1068 helptext => "Create the report/json files.",
1069 );
1070 }
1071  
1072 22 ▶sub rptfile {
Subroutine rptfile: called CC=1 SCAR=0.0
Pod undocumented
1073 22 return $opt->new(
1074 name => 'rptfile',
1075 option => '=s',
1076 default => 'mktest.rpt',
1077 helptext => 'Name of the file to store the email report in.',
1078 );
1079 }
1080  
1081 5 ▶sub rsyncbin {
Subroutine rsyncbin: called CC=1 SCAR=1.2
Pod undocumented
1082 return $opt->new(
1083 name => 'rsync', #old name
1084 option => '=s',
1085 default => 'rsync', # you might want a path there
1086 helptext => "The name of the 'rsync' programe.",
1087 configtext => "Which 'rsync' binary do you want to use?",
1088 configtype => 'prompt_file',
1089 0 ▶ configdft => sub { (_helper(whereis => ['rsync'])->())->[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1090 5 configord => 1,
1091 );
1092 }
1093  
1094 5 ▶sub rsyncsource {
Subroutine rsyncsource: called CC=1 SCAR=0.0
Pod undocumented
1095 5 return $opt->new(
1096 name => 'source',
1097 option => '=s',
1098 default => 'rsync://dromedary.p5h.org:5872/perl-current/',
1099 helptext => "The remote location of the rsync archive.",
1100 configtext => "Where would you like to rsync from?",
1101 configtype => 'prompt',
1102 configord => 2,
1103 );
1104 }
1105  
1106 5 ▶sub rsyncopts {
Subroutine rsyncopts: called CC=1 SCAR=0.0
Pod undocumented
1107 5 return $opt->new(
1108 name => 'opts',
1109 option => '=s',
1110 default => '-az --delete',
1111 helptext => "Options to use for the 'rsync' program",
1112 configtext => "Which arguments should be used for rsync?",
1113 configtype => 'prompt',
1114 configord => 3,
1115 );
1116 }
1117  
1118 6 ▶sub send_log {
Subroutine send_log: called CC=1 SCAR=1.2
Pod undocumented
1119 6 my $allow = [qw/ never on_fail always /];
1120 return $opt->new(
1121 name => 'send_log',
1122 option => '=s',
1123 default => 'on_fail',
1124 allow => $allow,
1125 helptext => "Send logfile to the CoreSmokeDB server.",
1126 configtext => "Do you want to send the logfile with the report?",
1127 0 ▶ configalt => sub {$allow},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1128 0 ▶ configdft => sub {'on_fail'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1129 6 configord => 4,
1130 );
1131 }
1132  
1133 6 ▶sub send_out {
Subroutine send_out: called CC=1 SCAR=1.2
Pod undocumented
1134 6 my $allow = [qw/ never on_fail always /];
1135 return $opt->new(
1136 name => 'send_out',
1137 option => '=s',
1138 default => 'never',
1139 allow => $allow,
1140 helptext => "Send out-file to the CoreSmokeDB server.",
1141 configtext => "Do you want to send the outfile with the report?",
1142 0 ▶ configalt => sub {$allow},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1143 0 ▶ configdft => sub {'never'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1144 6 configord => 5,
1145 );
1146 }
1147  
1148 4 ▶sub sendemailbin {
Subroutine sendemailbin: called CC=1 SCAR=1.2
Pod undocumented
1149 return $opt->new(
1150 name => 'sendemailbin',
1151 option => '=s',
1152 default => 'sendemail',
1153 helptext => "The name of the 'sendemail' program.",
1154 configtext => 'The fully qualified name of the executable.',
1155 0 ▶ configdft => sub { (_helper(whereis => ['sendemail'])->())->[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1156 4 );
1157 }
1158  
1159 4 ▶sub sendmailbin {
Subroutine sendmailbin: called CC=1 SCAR=1.2
Pod undocumented
1160 return $opt->new(
1161 name => 'sendmailbin',
1162 option => '=s',
1163 default => 'sendmail',
1164 helptext => "The name of the 'sendmail' program.",
1165 configtext => 'The fully qualified name of the executable.',
1166 0 ▶ configdft => sub { (_helper(whereis => ['sendmail'])->())->[0] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1167 4 );
1168 }
1169  
1170 4 ▶sub sendreport {
Subroutine sendreport: called CC=1 SCAR=0.0
Pod undocumented
1171 4 return $opt->new(
1172 name => 'sendreport',
1173 option => '!',
1174 default => 1,
1175 helptext => "Send the report mail/CoreSmokeDB.",
1176 );
1177 }
1178  
1179 6 ▶sub showcfg {
Subroutine showcfg: called CC=1 SCAR=0.0
Pod undocumented
1180 6 return $opt->new(
1181 name => 'showcfg',
1182 option => '!',
1183 default => 0,
1184 helptext => "Show a complete overview of all build configurations.",
1185 );
1186 }
1187  
1188 13 ▶sub skip_tests {
Subroutine skip_tests: called CC=1 SCAR=2.6
Pod undocumented
1189 return $opt->new(
1190 name => 'skip_tests',
1191 option => '=s',
1192 helptext => "Name of the file to store tests to skip.",
1193 configtext => "What file do you want to use to specify tests to skip.
1194 \t(Make empty for none)",
1195 configtype => 'prompt_file',
1196 configfnex => 1,
1197 0 ▶ configdft => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
1198 0 my $app = shift;
1199 0 $app->prefix . ".skiptests";
1200 },
1201 13 );
1202 }
1203  
1204 4 ▶sub smartsmoke {
Subroutine smartsmoke: called CC=1 SCAR=2.6
Pod undocumented
1205 return $opt->new(
1206 name => 'smartsmoke',
1207 option => '!',
1208 allow => [ 0, 1 ],
1209 default => 1,
1210 helptext => "Do not smoke when the source-tree did not change.",
1211 configtext => "Skip smoke unless patchlevel changed?",
1212 configtype => 'prompt_yn',
1213 0 ▶ configalt => sub { [qw/ Y n/] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1214 0 ▶ configdft => sub {'y'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1215 4 );
1216 }
1217  
1218 14 ▶sub smokedb_url {
Subroutine smokedb_url: called CC=1 SCAR=0.4
Pod undocumented
1219 14 my $default = 'https://perl5.test-smoke.org/api/report';
1220 return $opt->new(
1221 name => 'smokedb_url',
1222 option => '=s',
1223 default => $default,
1224 helptext => "The URL for sending reports to CoreSmokeDB.",
1225 configtext => "Where do I send the reports?",
1226 0 ▶ configdft => sub { $default },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1227 14 configord => 1,
1228 );
1229 }
1230  
1231 4 ▶sub sync {
Subroutine sync: called CC=1 SCAR=0.0
Pod undocumented
1232 4 return $opt->new(
1233 name => 'sync',
1234 option => 'fetch!',
1235 default => 1,
1236 helptext => "Synchronize the source-tree before smoking.",
1237 );
1238 }
1239  
1240 5 ▶sub sync_type {
Subroutine sync_type: called CC=1 SCAR=0.0
Pod undocumented
1241 5 return $opt->new(
1242 name => 'sync_type',
1243 option => '=s',
1244 allow => [qw/git rsync copy ftp snapshot/],
1245 default => 'git',
1246 helptext => 'The source tree sync method.',
1247 configtext => 'How would you like to sync the perl-source?',
1248 configtype => 'prompt',
1249 configalt => _helper( get_avail_sync => [ ]),
1250 );
1251 }
1252  
1253 4 ▶sub swbcc {
Subroutine swbcc: called CC=1 SCAR=0.0
Pod undocumented
1254 4 return $opt->new(
1255 name => 'swbcc',
1256 option => '=s',
1257 default => '-b',
1258 helptext => 'The syntax of the commandline switch for BCC.',
1259 );
1260 }
1261  
1262 4 ▶sub swcc {
Subroutine swcc: called CC=1 SCAR=0.0
Pod undocumented
1263 4 return $opt->new(
1264 name => 'swcc',
1265 option => '=s',
1266 default => '-c',
1267 helptext => 'The syntax of the commandline switch for CC.',
1268 );
1269 }
1270  
1271 7 ▶sub testmake { # This was an Alan Burlison request.
Subroutine testmake: called CC=1 SCAR=2.0
Pod undocumented
1272 7 require Config;
1273 return $opt->new(
1274 name => 'testmake',
1275 option => '=s',
1276 default => undef,
1277 helptext => "A different make program for 'make _test'.",
1278 configtext => "Specify a different make binary for 'make _test'?",
1279 0 ▶ configdft => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
1280 0 ▶ $Config::Config{make} ? $Config::Config{make} : 'make'
Branch: 1 branch
BranchTrueFalseTotal
$Config::Config{'make'} ? : 0 0 0
1281 },
1282 7 );
1283 }
1284  
1285 4 ▶sub to {
Subroutine to: called CC=1 SCAR=0.4
Pod undocumented
1286 4 my $mailing_list = 'daily-build-reports@perl.org';
1287 return $opt->new(
1288 name => 'to',
1289 option => '=s',
1290 default => $mailing_list,
1291 allow => [qr/@/],
1292 helptext => 'Where to send the reports to.',
1293 configtype => 'prompt',
1294 configtext => 'This is the email address used to send TO:',
1295 0 ▶ configdft => sub {$mailing_list},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1296 4 );
1297 }
1298  
1299 27 ▶sub ua_timeout {
Subroutine ua_timeout: called CC=1 SCAR=1.2
Pod undocumented
1300 return $opt->new(
1301 name => 'ua_timeout',
1302 option => '=i',
1303 default => 30,
1304 allow => qr/^[1-9][0-9]{0,5}$/,
1305 helptext => "The timeout to set the LWP::UserAgent.",
1306 configtext => "What should the timeout for the useragent be?",
1307 0 ▶ configdft => sub {30},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1308 27 configord => 3,
1309 );
1310 }
1311  
1312 6 ▶sub un_file {
Subroutine un_file: called CC=1 SCAR=2.6
Pod undocumented
1313 return $opt->new(
1314 name => 'un_file',
1315 option => '=s',
1316 helptext => "Name of the file with the 'user_note' text.",
1317 configtext => "In which file will you store your personal notes?
1318 \t(Leave empty for none.)",
1319 configtype => 'prompt_file',
1320 configfnex => 1,
1321 0 ▶ configdft => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
1322 0 my $app = shift;
1323 0 return $app->prefix . '.usernote';
1324 },
1325 6 );
1326 }
1327  
1328 6 ▶sub un_position {
Subroutine un_position: called CC=1 SCAR=2.6
Pod undocumented
1329 return $opt->new(
1330 name => 'un_position',
1331 option => '=s',
1332 allow => ['top', 'bottom'],
1333 default => 'bottom',
1334 helptext => "Position of the 'user_note' in the smoke report.",
1335 configtext => "Where do you want your personal notes in the report?",
1336 0 ▶ configalt => sub { [qw/top bottom/] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1337 0 ▶ configdft => sub {'bottom'},
Subroutine __ANON__: not called CC=1 SCAR=6.9
1338 6 );
1339 }
1340  
1341 6 ▶sub user_note {
Subroutine user_note: called CC=1 SCAR=0.0
Pod undocumented
1342 6 return $opt->new(
1343 name => 'user_note',
1344 option => '=s',
1345 helptext => "Extra text to insert into the smoke report.",
1346 );
1347 }
1348  
1349 0 ▶sub v {
Subroutine v: not called CC=1 SCAR=6.9
Pod undocumented
1350 return $opt->new(
1351 name => 'v',
1352 option => ':1',
1353 default => 1,
1354 allow => [0, 1, 2],
1355 helptext => "Log-level during smoke",
1356 configtext => "How verbose do you want the output?",
1357 0 ▶ configalt => sub { [0, 1, 2] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1358 0 );
1359 }
1360  
1361 0 ▶sub vmsmake {
Subroutine vmsmake: not called CC=1 SCAR=6.9
Pod undocumented
1362 0 return $opt->new(
1363 name => 'vmsmake',
1364 option => '=s',
1365 default => 'MMK',
1366 helptext => "The make program on VMS.",
1367 )
1368 }
1369  
1370 7 ▶sub w32args {
Subroutine w32args: called CC=1 SCAR=0.0
Pod undocumented
1371 7 return $opt->new(
1372 name => 'w32args',
1373 option => '=s@',
1374 default => [],
1375 helptext => "Extra options to pass to W32Configure.",
1376 )
1377 }
1378  
1379 7 ▶sub w32cc {
Subroutine w32cc: called CC=1 SCAR=0.0
Pod undocumented
1380 7 return $opt->new(
1381 name => 'w32cc',
1382 option => '=s',
1383 helptext => "The compiler on MSWin32.",
1384 );
1385 }
1386  
1387 7 ▶sub w32make {
Subroutine w32make: called CC=1 SCAR=0.0
Pod undocumented
1388 7 return $opt->new(
1389 name => 'w32make',
1390 option => '=s',
1391 default => 'gmake',
1392 helptext => "The make program on MSWin32.",
1393 );
1394 }
1395  
1396 31 ▶sub _helper {
Subroutine _helper: called CC=1 SCAR=4.6
1397 31 my ($helper, $args) = @_;
1398  
1399 0 ▶ return sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
1400 0 require Test::Smoke::Util::FindHelpers;
1401 0 my $run_helper = Test::Smoke::Util::FindHelpers->can($helper);
1402 0 my @values;
1403 0 ▶ if ($helper =~ m{(?:mailers)}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($helper =~ /(?:mailers)/) { } 0 0 0
1404 0 my %helpers = $run_helper->(@$args);
1405 0 @values = sort keys %helpers;
1406 }
1407 else {
1408 0 @values = $run_helper->( @$args );
1409 }
1410  
1411 0 return [ @values ];
1412 }
1413 31 }
1414  
1415 10 1;
1416  
1417 =head1 COPYRIGHT
1418  
1419 (c) 2002-2013, Abe Timmerman <abeltje@cpan.org> All rights reserved.
1420  
1421 With contributions from Jarkko Hietaniemi, Merijn Brand, Campo
1422 Weijerman, Alan Burlison, Allen Smith, Alain Barbet, Dominic Dunlop,
1423 Rich Rauenzahn, David Cantrell.
1424  
1425 This library is free software; you can redistribute it and/or modify
1426 it under the same terms as Perl itself.
1427  
1428 See:
1429  
1430 =over 4
1431  
1432 =item * L<http://www.perl.com/perl/misc/Artistic.html>
1433  
1434 =item * L<http://www.gnu.org/copyleft/gpl.html>
1435  
1436 =back
1437  
1438 This program is distributed in the hope that it will be useful,
1439 but WITHOUT ANY WARRANTY; without even the implied warranty of
1440 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1441  
1442 =cut
« lib/Test/Smoke/LogMixin.pm ↑ Summary blib/lib/Test/Smoke/App/AppOptionCollection.pm »