1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-07-20 12:45:50 +03:00
occt/tests/de/begin
Pasukhin Dmitry 29616ca8ff
Testing - Draw testing clear up (#595)
- Deleted slow V3D and performance tests under `tests/v3d` and `tests/perf`.
- Updated `de_before_script` in DE/IGES tests to set `new_resource_path` to a subfolder per file.
- Added cleanup logic in `de_after_script` to delete the temporary resource directories.
2025-07-06 22:44:42 +01:00

65 lines
1.7 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} {
# Ensure the parent directory exists
set parentDir [file dirname $theFileName]
if { ![file exists $parentDir] } {
file mkdir $parentDir
}
# Open the file for writing
set aFD [open $theFileName "wb"]
set aLineNo 0
# Write line by line
dict for {aKey aValue} $theOptions {
puts $aFD "${aKey} : ${aValue}"
}
close $aFD
}