The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Test::Smoke::App::Base - Baseclass for Test::Smoke::App::* applications.

SYNOPSIS

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

DESCRIPTION

  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::AppOption->new(
              name    => 'ddir',
              option  => '=s',
              helptxt => "Smoke Destination Directory.",
          ),

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

$mailer->run();

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.

special_options => $hashref

This is a hashref with the values of the allow-array, that hold a list of Test::Smoke::AppOptions.

Exceptions

None.

Test::Smoke::App::Base->configfile_option()

Returns a Test::Smoke::App::AppOption for 'configfile'.

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

Returns a Test::Smoke::App::AppOption for 'verbose'.

$app->show_config_option

$app->process_options()

This process constists of three (3) steps:

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.

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>

$app->options()

Arguments

None.

Returns

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

Exceptions

None.

COPYRIGHT

(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.

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.