1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-02 17:46:22 +03:00
occt/tests/de/begin
dpasukhi ea86bfe2fa Testing - Removing direct DCAF loading #147
DCAF require VISUALIZATION for correct work.
  In some scenario DRAWEXE can generate a dublicates of the
  internal static singletons. This means each dynamic library
  will have their own instance of the static singleton.
Update all direct library loading to use the DCAF plugin
  mechanism. This will ensure that the DCAF plugin is loaded
  only once and that the correct instance is used.
Originally issue is reproduced only Linux with dlopen with "RTLD_LAZY".
Can be resolved additionally adding "RTLD_LAZY | RTLD_GLOBAL" for dlopen
2024-11-05 17:00:06 +00:00

60 lines
1.5 KiB
Plaintext

pload OCAF
pload TOPTEST
pload XDE
cpulimit 1000
# Create a new document and set UndoLimit
NewDocument D BinXCAF
UndoLimit D 100
# Local length unit value
set lengthunit_start ""
# Open a transaction
NewCommand D
# Reads resource file, returns options from file as key-value dict
proc parse_resource_file {theFileName} {
# Creating empty dictionary
set aDict [dict create];
# Check for resource file
if { [info exists theFileName] == 0 } {
puts "Error: resource file \"${theFileName}\" isn't found"
return $aDict
}
# Open a resource file
set aFD [open "${theFileName}" "rb"]
set aLineNo 0
# Read line by line
while {[gets $aFD aLine] !=-1 } {
incr aLineNo
# Clear the line from comment
if {[regexp {(^[^!]+)} $aLine match aClearLine]} {
# remove spaces
set aClearLine [string trim $aClearLine]
if {[string length $aClearLine] != 0} {
if {[regexp {(\S+)\s*:\s*(\S*)} $aClearLine match aKey aValue]} {
dict set aDict $aKey $aValue
} else {
puts "Error: syntax error in resource file at line: ${aLineNo}"
}
}
}
}
close $aFD
return $aDict
}
# Creates new resource file with options as key-value dict
proc create_resource_file {theFileName theOptions} {
# Open a resource file
set aFD [open "${theFileName}" "wb"]
set aLineNo 0
# Write line by line
dict for {aKey aValue} $theOptions {
puts $aFD "${aKey} : ${aValue}"
}
close $aFD
}