Skip to content

Commit

Permalink
Item9312: Don't die on cwd change
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@8160 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Jul 13, 2010
1 parent 3c019ac commit b378c12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions UnitTestContrib/lib/Unit/TestRunner.pm
Expand Up @@ -39,7 +39,7 @@ sub start {
@{ $this->{initialINC} } = @INC;
my $passes = 0;

my $start_cwd = Cwd->cwd();
my ($start_cwd) = Cwd->cwd() =~ m/^(.*)$/;
print "Starting CWD is $start_cwd \n";

# First use all the tests to get them compiled
Expand Down Expand Up @@ -130,7 +130,11 @@ sub start {
$action = runOne( $tester, $suite, $testToRun );
}

die "CWD changed to " . Cwd->cwd() . " by previous test!! \n" if ( Cwd->cwd() ne $start_cwd) ;
if ( Cwd->cwd() ne $start_cwd) {
print "CWD changed to " . Cwd->cwd()
. " by previous test!! \n";
chdir $start_cwd or die "Cannot change back to previous $start_cwd\n";
}

# untaint action for the case where the test is run in
# another process
Expand Down

0 comments on commit b378c12

Please sign in to comment.