Skip to content

Commit

Permalink
cleanup test files
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed Jun 17, 2019
1 parent 9a281cd commit 7dff59c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions t/22-readstream.t
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,5 @@ is_deeply $prof{NEW_FID}, [
[ 1, 0, 0, $fid_flags, 0, 0, '-e' ]
], 'NEW_FID args';

unlink $out;
done_testing();
2 changes: 2 additions & 0 deletions t/50-errno.t
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ SKIP: {
ok not eval { example_xsub(0, "die"); 1; };
like $@, qr/^example_xsub\(die\)/;

unlink $nytprof_out;

exit 0;

sub busy {
Expand Down
10 changes: 9 additions & 1 deletion t/lib/NYTProfTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ sub run_test_group {
} );

report_env_influence($group);
unlink $profile_datafile;
unlink $group."_outdir/*";
rmdir $group."_outdir";
}


Expand Down Expand Up @@ -368,6 +371,7 @@ sub run_test {
unlink <$outdir/*>;

verify_csv_report($test, $tag, $test_datafile, $outdir);
unlink <$outdir/*>;
}
elsif ($type eq 'pf') {
verify_platforms_csv_report($test, $tag, $test_datafile, $outdir);
Expand Down Expand Up @@ -445,6 +449,7 @@ sub verify_data {
$profile->normalize_variables(1); # and options
dump_profile_to_file($profile, $test.'_new', $test.'_newp');
is_file_content_same($test.'_new', $test, "$test match generated profile data for $tag");
unlink $test.'_new';
}
}

Expand Down Expand Up @@ -570,6 +575,7 @@ sub verify_calls_report {
note "generating $got_file";
run_command("$perl $nytprofcalls $profile_datafile -stable --calls > $got_file");
is_file_content_same($got_file, $test, "$test match generated calls data for $tag");
unlink $got_file;
}


Expand Down Expand Up @@ -597,6 +603,7 @@ sub verify_csv_report {

my @got = slurp_file($csvfile);
my @expected = slurp_file($test);
unlink $csvfile;

if ($opts{d}) {
print "GOT:\n";
Expand Down Expand Up @@ -672,6 +679,7 @@ sub verify_csv_report {
write_out_file($test.'_new', join("\n", @got,''), $test.'_newp');
diff_files($test, $test.'_new', $test.'_newp');
};
unlink $test.'_newp';
is(join("\n", @accuracy_errors), '', "$test times should be reasonable");
}

Expand All @@ -693,7 +701,7 @@ sub verify_platforms_csv_report {
$match_result = $match_result && $got =~ m/$_/;
}
close (EXPECTED);

unlink $outfile;
ok $match_result, "$outfile file matches $test";
}

Expand Down
4 changes: 4 additions & 0 deletions t/test14.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ use NYTProfTest;
$ENV{DISABLE_NYTPROF_SAWAMPERSAND} = 1;

run_test_group;

unlink glob ('auto/test14/*');
rmdir 'auto/test14';
rmdir 'auto';
5 changes: 4 additions & 1 deletion t/test30-fork-0.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use Test::More;
use lib qw(t/lib);
use NYTProfTest;

plan skip_all => "doesn't work with fork() emulation" if (($^O eq "MSWin32") || ($^O eq 'VMS'));
plan skip_all => "doesn't work with fork() emulation"
if ($^O eq "MSWin32") || ($^O eq 'VMS');

run_test_group;

unlink glob('nytprof_test30-fork-0.out.*');
2 changes: 2 additions & 0 deletions t/test51-enable.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ run_test_group({
'main::sub7' => 1,
'DB::finish_profile' => 1,
}, "$file_c sub calls");

unlink $file_b, $file_c;
},
});

Expand Down

0 comments on commit 7dff59c

Please sign in to comment.