save_ok hook

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2026-04-04 14:58:25 -07:00
parent e3d1bb09b0
commit d6e826ef8b
1 changed files with 15 additions and 10 deletions

View File

@ -582,22 +582,27 @@ proc save_ok_main {} {
}
} else {
foreach test $argv {
save_ok $test
if { [lsearch [group_tests "all"] $test] == -1 } {
puts "Error: test $test not found."
} else {
save_ok $test
}
}
}
}
# hook for pvt/public sync.
proc save_ok { test } {
if { [lsearch [group_tests "all"] $test] == -1 } {
puts "Error: test $test not found."
save_ok_file $test
}
proc save_ok_file { test } {
set ok_file [test_ok_file $test]
set log_file [test_log_file $test]
if { ! [file exists $log_file] } {
puts "Error: log file $log_file not found."
} else {
set ok_file [test_ok_file $test]
set log_file [test_log_file $test]
if { ! [file exists $log_file] } {
puts "Error: log file $log_file not found."
} else {
file copy -force $log_file $ok_file
}
file copy -force $log_file $ok_file
}
}