Mercurial > hg > Gears > Gears
changeset 703:cf517d3f5ab9
...
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 22 Aug 2020 19:59:28 +0900 |
parents | fb0a9d082360 |
children | d05e327cbc50 |
files | src/parallel_execution/perlTests/generate_stub.t |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/perlTests/generate_stub.t Sat Aug 22 19:51:17 2020 +0900 +++ b/src/parallel_execution/perlTests/generate_stub.t Sat Aug 22 19:59:28 2020 +0900 @@ -12,11 +12,19 @@ my ($targetFile, $wantCFile) = @_; subtest "generate_stub.pl $targetFile" => sub { - my ($_fh, $testOutputFile) = tempfile(); + my ($_fh, $testOutputFile) = tempfile( UNLINK => 1 ); close $_fh; system("perl", "generate_stub.pl", "-o", $testOutputFile, $targetFile); is(compare($wantCFile, $testOutputFile), 0, "$wantCFile eq $testOutputFile"); + + if(compare($wantCFile, $testOutputFile) != 0 ) { + my $oldOutputFile = $testOutputFile; + ($_fh, $testOutputFile) = tempfile(); + close $_fh; + system("perl", "generate_stub.pl", "-o", $testOutputFile, $targetFile); + print "[INFO] $oldOutputFile is removed. Please show $testOutputFile\n"; + } }; }