@@ -368,16 +368,16 @@ proc build {{Path_Or_File "."} args} {
368
368
# Catch any errors from the build and handle them below
369
369
set BuildErrorCode [catch {LocalBuild $BuildName $IncludeFile {*}$args } BuildErrMsg]
370
370
set LocalBuildErrorInfo $::errorInfo
371
+
372
+ set ReportYamlErrorCode [catch {FinishBuildYaml $BuildName } BuildYamlErrMsg]
373
+ set LocalBuildYamlErrorInfo $::errorInfo
374
+
371
375
set BuildStarted " false"
372
376
373
377
# Try to create reports, even if the build failed
374
378
set ReportErrorCode [catch {AfterBuildReports $BuildName } ReportsErrMsg]
375
379
set LocalReportErrorInfo $::errorInfo
376
380
377
- if {($ReportErrorCode != 0) || ($ScriptErrorCount != 0)} {
378
- CallbackOnError_AfterBuildReports $LocalReportErrorInfo
379
- }
380
-
381
381
StopTranscript ${BuildName}
382
382
383
383
set BuildName " "
@@ -386,15 +386,19 @@ proc build {{Path_Or_File "."} args} {
386
386
set Log2ErrorCode [catch {Log2Osvvm $::osvvm::TranscriptFileName } ReportsErrMsg]
387
387
set Log2ErrorInfo $::errorInfo
388
388
389
+ # Run Callbacks on Error after trying to produce all reports
389
390
if {$BuildErrorCode != 0 || $AnalyzeErrorCount > 0 || $SimulateErrorCount > 0} {
390
391
CallbackOnError_Build $Path_Or_File $BuildErrMsg $LocalBuildErrorInfo
391
392
}
393
+ if {($ReportErrorCode != 0) || ($ScriptErrorCount != 0)} {
394
+ CallbackOnError_AfterBuildReports $LocalReportErrorInfo
395
+ }
392
396
# Fail on Test Case Errors
393
397
if {($::osvvm::BuildStatus eq " FAILED" ) && ($::osvvm::FailOnTestCaseErrors )} {
394
398
error " Test finished with Test Case Errors"
395
399
}
396
400
# Fail on Report / Script Errors?
397
- if {($ReportErrorCode != 0) || ($Log2ErrorCode != 0) || ($ScriptErrorCount != 0)} {
401
+ if {($ReportYamlErrorCode != 0) || ( $ ReportErrorCode != 0) || ($Log2ErrorCode != 0) || ($ScriptErrorCount != 0)} {
398
402
# End Simulation with errors
399
403
if {$::osvvm::FailOnReportErrors } {
400
404
error " Test finished with either Report or Script (wave.do) errors."
@@ -443,7 +447,6 @@ proc LocalBuild {BuildName Path_Or_File args} {
443
447
vendor_ReportCodeCoverage $BuildName $::osvvm::CoverageDirectory
444
448
}
445
449
446
- FinishBuildYaml $BuildName
447
450
}
448
451
449
452
proc AfterBuildReports {BuildName} {
0 commit comments