Test::S...p::Base(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

πŸŽ€ Test::S...p::Base(3) πŸŽ€

okay bestie, welcome to the User Contributed Perl Documentation corner of the internet, where we're talking about Test::S...p::Base(3). yes the name is literally abbreviated with dots, we don't make the rules πŸ’…


✨ NAME ✨

Test::Smoke::App::Base β€” the Baseclass for all the Test::Smoke::App::* applications. it's giving parent energy, it's giving "everyone inherits from me" πŸ‘‘


🌸 SYNOPSIS 🌸

    package Test::Smoke::App::Mailer;
    use base 'Test::Smoke::App::Base';
    sub run {...}

that's it, that's the vibe. you say use base and suddenly you're a whole app πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, here's a real usage moment:

    use Test::Smoke::App::Mailer;
    my $mailer = Test::Smoke::App::Mailer->new(
        main_options => [
            Test::Smoke::App::AppOption->new(
                name     => 'mailer',
                option   => '=s',
                allow    => [qw/MIME::lite sendmail/],
                helptext => "Mailsystem to use for sendig reports.",
            ),
        ],
        genral_options => [
            Test::Smoke::App::AppOption->new(
                name    => 'ddir',
                option  => '=s',
                helptxt => "Smoke Destination Directory.",
            ),

        ],
        special_options => {
            'MIME::Lite' => [
                mserver(),
                msport(),
                msuser(),
                mspass(),
            ],
            'sendmail' => [],
        },
    );

  $mailer->run();
no bestie I did not typo genral_options or helptxt β€” that's literally what's in the source, we copy character for character in this house πŸ™ˆ

πŸ’œ Test::Smoke::App->new(%arguments) πŸ’œ

Arguments

Named:

  • main_options => $list_of_test_smoke_appoptions
  • general_options => $list_of_test_smoke_appoptions

these options are always valid. no cap, always.

  • special_options => $hashref

this is a hashref where the keys are the values of the "allow"-array, and each one holds a list of Test::Smoke::AppOptions.

Exceptions

None. literally none. nothing to see here 🫢


πŸ“ Test::Smoke::App::Base->configfile_option() πŸ“

returns a Test::Smoke::App::AppOption for 'configfile'. slay.


⭐ Test::Smoke::App::Base->verbose_option() ⭐

returns a Test::Smoke::App::AppOption for 'verbose'. iconic.


πŸ’… $app->show_config_option πŸ’…

(it's here, it exists, the original says nothing else about it, and honestly? mysterious main character energy πŸ’€)


🌈 $app->process_options() 🌈

this process constists of three (3) steps β€” yes, three, we're counting:

  1. pre_process_options this step organizes the options in a AppOptionCollection.
  2. get_options this step processes the arguments passed on the command line.
  3. post_process_options this step integrates the arguments, their coded-defaults, config-file values and command-line overrides. the full glow-up pipeline ✨

Arguments

None.

Returns

the object-instance.

Exceptions

None.


🧚 $app->option($option) 🧚

return the value of an option.

Arguments

Positional.

$option_name

Returns

the value of that option if applicable.

Exceptions

  • Invalid option 'blah' ($name = $type)>
  • Option 'blah' is invalid for $name = $type>
both of those trailing > characters are exactly how they appear, bestie, I am not touching them 😭

πŸ‘‘ $app->options() πŸ‘‘

Arguments

None.

Returns

a hash (list) of all options that apply to this instance of the app.

Exceptions

None.


(c) 2002-2013, Abe Timmerman <abeltje@cpan.org> All rights reserved.

with contributions from Jarkko Hietaniemi, Merijn Brand, Campo Weijerman, Alan Burlison, Allen Smith, Alain Barbet, Dominic Dunlop, Rich Rauenzahn, David Cantrell. the whole squad showed up and ate 🫢

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

see:

this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. read that again if you need to, it's serious πŸ’€


and that's the whole page, bestie! this was Test::S...p::Base(3) from perl v5.42.0, dated 2025-07-25. go forth and inherit responsibly πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from