Files
OCCT/tests/bugs/fclasses/bug1281
Pasukhin Dmitry d15ffb983d DRAW - Continue pload after missing plugins (#1308)
- Catch Draw plugin load errors per resource so group loads can continue after an optional toolkit is absent.
- Report loaded and skipped plugin counts, and return an error only when no requested plugins were loaded.
- Add a regression test covering mixed missing/valid plugins and the all-missing error path.
2026-06-14 10:44:34 +01:00

55 lines
1.6 KiB
Plaintext

puts "============"
puts "GH1281"
puts "============"
puts ""
#######################################################################
# pload ALL should keep loading remaining plugins when one plugin library
# from the resource list is absent.
#######################################################################
set aPluginFileName "Bug1281DrawPlugin"
set aPluginFilePath "${imagedir}/${aPluginFileName}"
set aScriptFilePath "${imagedir}/TKTopTest.tcl"
set aPluginVar "CSF_${aPluginFileName}Defaults"
set aMarker "::bug1281_plugin_after_missing"
set anOldDefaults [dgetenv ${aPluginVar}]
unset -nocomplain ${aMarker}
set aFile [open ${aPluginFilePath} w]
puts ${aFile} "ALL : MISSING, VALID"
puts ${aFile} "MISSING : TKMissingDrawPluginForBug1281"
puts ${aFile} "VALID : TKTopTest"
close ${aFile}
set aFile [open ${aScriptFilePath} w]
puts ${aFile} "set ${aMarker} 1"
close ${aFile}
dsetenv ${aPluginVar} ${imagedir}
if {[catch {pload -${aPluginFileName} ALL} aResult]} {
puts "Error: pload ALL aborted on a missing plugin: ${aResult}"
}
if {![info exists ${aMarker}]} {
puts "Error: pload ALL did not continue loading plugins after a missing plugin"
}
set aFile [open ${aPluginFilePath} w]
puts ${aFile} "ALL : MISSING"
puts ${aFile} "MISSING : TKMissingDrawPluginForBug1281"
close ${aFile}
if {![catch {pload -${aPluginFileName} ALL} aResult]} {
puts "Error: pload ALL did not report an error when every plugin was missing"
}
if {${anOldDefaults} == ""} {
dsetenv ${aPluginVar}
} else {
dsetenv ${aPluginVar} ${anOldDefaults}
}
unset -nocomplain ${aMarker}
file delete -force ${aPluginFilePath}
file delete -force ${aScriptFilePath}