Skip to content

Commit c8f1770

Browse files
committed
Moved WriteOsvvmSettingsYaml to FinishBuildYaml. Moved FinishBuildYaml so it runs even if the build fails.
1 parent 166f4c5 commit c8f1770

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

OsvvmScriptsCore.tcl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,16 @@ proc build {{Path_Or_File "."} args} {
368368
# Catch any errors from the build and handle them below
369369
set BuildErrorCode [catch {LocalBuild $BuildName $IncludeFile {*}$args} BuildErrMsg]
370370
set LocalBuildErrorInfo $::errorInfo
371+
372+
set ReportYamlErrorCode [catch {FinishBuildYaml $BuildName} BuildYamlErrMsg]
373+
set LocalBuildYamlErrorInfo $::errorInfo
374+
371375
set BuildStarted "false"
372376

373377
# Try to create reports, even if the build failed
374378
set ReportErrorCode [catch {AfterBuildReports $BuildName} ReportsErrMsg]
375379
set LocalReportErrorInfo $::errorInfo
376380

377-
if {($ReportErrorCode != 0) || ($ScriptErrorCount != 0)} {
378-
CallbackOnError_AfterBuildReports $LocalReportErrorInfo
379-
}
380-
381381
StopTranscript ${BuildName}
382382

383383
set BuildName ""
@@ -386,15 +386,19 @@ proc build {{Path_Or_File "."} args} {
386386
set Log2ErrorCode [catch {Log2Osvvm $::osvvm::TranscriptFileName} ReportsErrMsg]
387387
set Log2ErrorInfo $::errorInfo
388388

389+
# Run Callbacks on Error after trying to produce all reports
389390
if {$BuildErrorCode != 0 || $AnalyzeErrorCount > 0 || $SimulateErrorCount > 0} {
390391
CallbackOnError_Build $Path_Or_File $BuildErrMsg $LocalBuildErrorInfo
391392
}
393+
if {($ReportErrorCode != 0) || ($ScriptErrorCount != 0)} {
394+
CallbackOnError_AfterBuildReports $LocalReportErrorInfo
395+
}
392396
# Fail on Test Case Errors
393397
if {($::osvvm::BuildStatus eq "FAILED") && ($::osvvm::FailOnTestCaseErrors)} {
394398
error "Test finished with Test Case Errors"
395399
}
396400
# Fail on Report / Script Errors?
397-
if {($ReportErrorCode != 0) || ($Log2ErrorCode != 0) || ($ScriptErrorCount != 0)} {
401+
if {($ReportYamlErrorCode != 0) || ($ReportErrorCode != 0) || ($Log2ErrorCode != 0) || ($ScriptErrorCount != 0)} {
398402
# End Simulation with errors
399403
if {$::osvvm::FailOnReportErrors} {
400404
error "Test finished with either Report or Script (wave.do) errors."
@@ -443,7 +447,6 @@ proc LocalBuild {BuildName Path_Or_File args} {
443447
vendor_ReportCodeCoverage $BuildName $::osvvm::CoverageDirectory
444448
}
445449

446-
FinishBuildYaml $BuildName
447450
}
448451

449452
proc AfterBuildReports {BuildName} {

OsvvmScriptsCreateYamlReports.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ proc StartBuildYaml {BuildName} {
7878
set RunFile [open ${::osvvm::OsvvmBuildYamlFile} w]
7979
puts $RunFile "Version: $::osvvm::OsvvmVersion"
8080
puts $RunFile "Date: $StartTime"
81-
WriteOsvvmSettingsYaml $RunFile
8281
close $RunFile
8382
}
8483

@@ -107,6 +106,8 @@ proc FinishBuildYaml {BuildName} {
107106
puts $RunFile " AnalyzeErrorCount: $AnalyzeErrorCount"
108107
puts $RunFile " SimulateErrorCount: $BuildErrorCode"
109108

109+
WriteOsvvmSettingsYaml $RunFile
110+
110111
close $RunFile
111112

112113
puts "Build Start time [clock format $BuildStartTime -format {%T %Z %a %b %d %Y }]"

0 commit comments

Comments
 (0)