Skip to content

Commit

Permalink
Item14237: Added attributes runInNewProcess and runInTaintMode
Browse files Browse the repository at this point in the history
run_in_new_process() method acts now as initializer for corresponding
attribute.
  • Loading branch information
vrurg committed May 10, 2018
1 parent 1679ca6 commit e934815
Showing 1 changed file with 50 additions and 6 deletions.
56 changes: 50 additions & 6 deletions UnitTestContrib/lib/Unit/TestCase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,35 @@ has testSuite => ( is => 'ro', required => 1, );

=begin TML
---+++ ObjectMethod runInNewProcess
Boolean, _true_ if test must be run in a separate process.
=cut

has runInNewProcess => (
is => 'rw',
lazy => 1,
builder => 'run_in_new_process',
);

=begin TML
---+++ ObjectMethod runInTaintMode
Boolean, _true_ if test process must be run in taint mode. Valid only if
=runInNewProcess= is _true_.
=cut

has runInTaintMode => (
is => 'rw',
lazy => 1,
builder => 'run_in_taint_mode',
);

=begin TML
---++ METHODS
=cut
Expand Down Expand Up @@ -134,19 +163,34 @@ sub tear_down {
---+++ ObjectMethod run_in_new_process()
Override this method to return true
in test suites that should be run in a separate process.
This facility is provided for tests that make non-reversible
changes to the system state e.g. tests that enable
non-default plugins, whose initPlugin() handlers
could do just about anything
Initializer for =runInNewProcess= attribute.
Override this method to return true in test suites that should be run in a
separate process. This facility is provided for tests that make non-reversible
changes to the system state e.g. tests that enable non-default plugins, whose
initPlugin() handlers could do just about anything
=cut

sub run_in_new_process {
return;
}

=begin TML
---+++ ObjectMethod run_in_taint_mode()
Initializer for =runInTaintMode= attribute.
Valid only if =runInNewProcess= is true and similar in use to
=run_in_new_process()=.
=cut

sub run_in_taint_mode {
return;
}

sub _fixture_test {
my ( $this, $set_up, $test ) = @_;
$this->$set_up();
Expand Down

0 comments on commit e934815

Please sign in to comment.