Skip to content

Commit

Permalink
Reduce the number of 'Forgot to call init()' warnings during testing (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuelsmann committed Jul 31, 2021
1 parent 94d63c5 commit a756000
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 5 deletions.
12 changes: 7 additions & 5 deletions t/05_condition_nested.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ use lib qw(t);

use Test::More;


require Workflow::Factory;
require Workflow::Persister::DBI;


my $debug = $ENV{TEST_DEBUG};

# base name used to find config files
Expand All @@ -32,6 +27,13 @@ else {
Log::Log4perl::easy_init($Log::Log4perl::OFF);
}




require Workflow::Factory;
require Workflow::Persister::DBI;


plan tests => 26;

my $workflow_conf = $cfgbase . '/workflow_def_wfnest.xml';
Expand Down
5 changes: 5 additions & 0 deletions t/condition.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use TestUtil;
use Test::More tests => 11;
use Test::Exception;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require_ok( 'Workflow::Condition' );

dies_ok { Workflow::Condition->evaluate() };
Expand Down
6 changes: 6 additions & 0 deletions t/condition_evaluate.t
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@

#!/usr/bin/env perl

use strict;
use lib qw(t);
use TestUtil;
use Test::More tests => 1;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


my $wf;

require_ok( 'Workflow::Condition::Evaluate' );
Expand Down
5 changes: 5 additions & 0 deletions t/config.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use TestUtil;
use Test::More tests => 50;
use Test::Exception;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


my ($parser);

#testing load
Expand Down
5 changes: 5 additions & 0 deletions t/context.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use TestUtil;
use Test::More tests => 9;
use Test::Exception;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require_ok( 'Workflow::Context' );

ok(my $context = Workflow::Context->new());
Expand Down
5 changes: 5 additions & 0 deletions t/factory.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use TestUtil;
use Test::More tests => 7;
use Test::Exception;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require_ok( 'Workflow::Factory' );

my $factory = Workflow::Factory->instance();
Expand Down
5 changes: 5 additions & 0 deletions t/factory_subclass.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use lib qw(t);
use TestUtil;
use Test::More tests => 5;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require_ok( 'FactorySubclass' );
my $factory = FactorySubclass->instance();
is( ref( $factory ), 'FactorySubclass',
Expand Down
5 changes: 5 additions & 0 deletions t/history.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use lib qw(t);
use TestUtil;
use Test::More tests => 18;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require_ok( 'Workflow::History' );

my %params = (
Expand Down
5 changes: 5 additions & 0 deletions t/persister.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use TestUtil;
use Test::Exception;
use Test::More tests => 6;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require_ok( 'Workflow::Persister' );

dies_ok { Workflow::Persister->create_workflow(); };
Expand Down
5 changes: 5 additions & 0 deletions t/persister_auto_generate_id.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ use Test::More; # done_testing
use Test::Exception;
use Mock::MonkeyPatch;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require Workflow::Factory;
require_ok( 'Workflow::Persister::DBI::AutoGeneratedId' );
require_ok( 'Workflow::Persister::DBI' );
Expand Down
5 changes: 5 additions & 0 deletions t/persister_sequence_id.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ use Test::More; # done_testing
use Test::Exception;
use Mock::MonkeyPatch;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require Workflow::Factory;
require_ok( 'Workflow::Persister::DBI::AutoGeneratedId' );
require_ok( 'Workflow::Persister::DBI' );
Expand Down
5 changes: 5 additions & 0 deletions t/validator.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use TestUtil;
use Test::More tests => 2;
use Test::Exception;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require_ok( 'Workflow::Validator' );

dies_ok { Workflow::Validator->validate(); };
5 changes: 5 additions & 0 deletions t/validator_has_required_field.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ use lib qw(t);
use TestUtil;
use Test::More tests => 1;

no warnings 'once';
require Log::Log4perl;
Log::Log4perl::easy_init($Log::Log4perl::OFF);


require_ok( 'Workflow::Validator::HasRequiredField' );

0 comments on commit a756000

Please sign in to comment.