[test suite] establish new test.log file in --list mode

This commit is contained in:
Michael Rash 2014-03-06 23:52:56 -05:00
parent f476570b2a
commit f3a02b5d2d

View File

@ -652,7 +652,9 @@ if ($saved_last_results) {
"to: ${output_dir}.last/\n\n");
}
unless ($list_mode) {
copy $init_file, "$output_dir/init" if -e $init_file;
}
if ($enable_valgrind) {
if ($previous_valgrind_coverage_dir) {
@ -723,8 +725,10 @@ if ($enable_valgrind) {
&logr("\n");
unless ($list_mode) {
&remove_permissions_warnings() unless $include_permissions_warnings;
&restore_gpg_dirs();
}
my $total_elapsed_seconds = time() - $start_time;
my $total_elapsed_minutes = sprintf "%.2f", ($total_elapsed_seconds / 60);
@ -749,7 +753,9 @@ if ($fuzzing_ctr > 0) {
}
&logr("[+] $passed/$failed/$executed test buckets passed/failed/executed\n\n");
unless ($list_mode) {
copy $logfile, "$output_dir/$logfile" or die $!;
}
if ($pinentry_fail) {
if ($killall_path) {
@ -5602,6 +5608,7 @@ sub init() {
}
unlink $init_file if -e $init_file;
unlink $logfile if -e $logfile;
if ($test_include) {
for my $re (split /\s*,\s*/, $test_include) {
@ -5783,7 +5790,9 @@ sub init() {
}
sub preserve_previous_test_run_results() {
unless ($list_mode) {
return if $list_mode;
if (-d $output_dir) {
if (-d "${output_dir}.last") {
rmtree "${output_dir}.last"
@ -5817,7 +5826,6 @@ sub preserve_previous_test_run_results() {
next unless -e $file;
unlink $file or die "[*] Could not unlink($file)";
}
}
return;
}
@ -6445,7 +6453,8 @@ sub write_test_file() {
sub logr() {
my $msg = shift;
print STDOUT $msg;
open F, ">> $logfile" or die $!;
open F, ">> $logfile"
or die "[*] Could not append msg '$msg' to $logfile: $!";
print F $msg;
close F;
return;