diff --git a/dox/dev_guides/tests/tests.md b/dox/dev_guides/tests/tests.md index 2004d4850f..52bfb1f030 100644 --- a/dox/dev_guides/tests/tests.md +++ b/dox/dev_guides/tests/tests.md @@ -7,7 +7,7 @@ This document provides OCCT developers and contributors with an overview and practical guidelines for work with OCCT automatic testing system. -Reading the Introduction is sufficient for OCCT developers to use the test system to control non-regression of the modifications they implement in OCCT. Other sections provide a more in-depth description of the test system, required for modifying the tests and adding new test cases. +Reading the Introduction should be sufficient for developers to use the test system to control non-regression of the modifications they implement in OCCT. Other sections provide a more in-depth description of the test system, required for modifying the tests and adding new test cases. @subsection testmanual_1_1 Basic Information @@ -28,10 +28,11 @@ Some tests involve data files (typically CAD models) which are located separatel @subsection testmanual_1_2 Intended Use of Automatic Tests Each modification made in OCCT code must be checked for non-regression -by running the whole set of tests. The developer who does the modification +by running the whole set of tests. The developer who makes the modification is responsible for running and ensuring non-regression for the tests available to him. -Note that many tests are based on data files that are confidential and thus available only at OPEN CASCADE. Thus official certification testing of the changes before integration to master branch of official OCCT Git repository (and finally to the official release) is performed by OPEN CASCADE in any case. +Note that many tests are based on data files that are confidential and thus available only at OPEN CASCADE. +The official certification testing of each change before its integration to master branch of official OCCT Git repository (and finally to the official release) is performed by OPEN CASCADE to ensure non-regression on all existing test cases and supported platforms. Each new non-trivial modification (improvement, bug fix, new feature) in OCCT should be accompanied by a relevant test case suitable for verifying that modification. This test case is to be added by the developer who provides the modification. @@ -49,11 +50,10 @@ For this it is recommended to add a file *DrawAppliInit* in the directory which Example (Windows) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl} +~~~~~{.tcl} set env(CSF_TestDataPath) $env(CSF_TestDataPath)\;d:/occt/test-data -return ;# this is to avoid an echo of the last command above in cout +~~~~~ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note that variable *CSF_TestDataPath* is set to default value at DRAW start, pointing at the folder $CASROOT/data. In this example, subdirectory d:/occt/test-data is added to this path. Similar code could be used on Linux and Mac OS X except that on non-Windows platforms colon ":" should be used as path separator instead of semicolon ";". @@ -169,17 +169,19 @@ test: Run specified test case The detailed rules of creation of new tests are given in section 3. The following short description covers the most typical situations: -Use prefix bug followed by Mantis issue ID and, if necessary, additional suffixes, for naming the test script and DRAW commands specific for this test case. +Use prefix bug followed by Mantis issue ID and, if necessary, additional suffixes, for naming the test script, data files, and DRAW commands specific for this test case. -1. If the test requires C++ code, add it as new DRAW command(s) in one of files in *QABugs* package. Note that this package defines macros *QVERIFY* and *QCOMPARE*, thus code created for QTest or GoogleTest frameworks can be used with minimal modifications. -2. Add script(s) for the test case in the subfolder corresponding to the relevant OCCT module of the group bugs ($CASROOT/tests/bugs). See the correspondence map. +1. If the test requires C++ code, add it as new DRAW command(s) in one of files in *QABugs* package. +2. Add script(s) for the test case in the subfolder corresponding to the relevant OCCT module of the group *bugs* ($CASROOT/tests/bugs). See the correspondence map. 3. In the test script: * Load all necessary DRAW modules by command *pload*. * Use command *locate_data_file* to get a path to data files used by test script. (Make sure to have this command not inside catch statement if it is used.) * Use DRAW commands to reproduce the situation being tested. - * If test case is added to describe existing problem and the fix is not available, add TODO message for each error to mark it as known problem. The TODO statements must be specific so as to match the actually generated messages but not all similar errors. - * Make sure that in case of failure the test produces message containing word "Error" or other recognized by test system as error (see files parse.rules). -4. If the test case uses data file(s) not yet present in the test database, these can be put to subfolder data of the test grid, and integrated to Git along with the test case. + * Make sure that in case of failure the test produces message containing word "Error" or other recognized by test system as error (add new error patterns in file parse.rules if necessary). + * If test case reports error due to existing problem and the fix is not available, add @ref testmanual_3_6 "TODO" statement for each error to mark it as known problem. The TODO statements must be specific so as to match the actually generated messages but not all similar errors. + * To check expected output which should be obtained as a result of a test, add @ref testmanual_3_7 "REQUIRED" statement for each line of output to mark it as required. + * If test case produces error messages (contained in parse.rules) which are expected in that test and should not be considered as its failure (e.g. test for checkshape command), add REQUIRED statement for each error to mark it as required output. +4. If the test uses data file(s) not yet present in the test database, these can be put to (sub)directory pointed out by *CSF_TestDataPath* variable for running test. The files should be attached to Mantis issue corresponding to the modification being tested. 5. Check that the test case runs as expected (test for fix: OK with the fix, FAILED without the fix; test for existing problem: BAD), and integrate to Git branch created for the issue. Example: @@ -188,18 +190,18 @@ Example: ~~~~~ git status –short -A tests/bugs/heal/data/OCC210a.brep -A tests/bugs/heal/data/OCC210a.brep +A tests/bugs/heal/data/bug210_a.brep +A tests/bugs/heal/data/bug210_b.brep A tests/bugs/heal/bug210_1 A tests/bugs/heal/bug210_2 ~~~~~ * Test script -~~~~~ +~~~~~{.tcl} puts "OCC210 (case 1): Improve FixShape for touching wires" -restore [locate_data_file OCC210a.brep] a +restore [locate_data_file bug210_a.brep] a fixshape result a 0.01 0.01 checkshape result @@ -212,10 +214,10 @@ checkshape result Standard OCCT tests are located in subdirectory tests of the OCCT root folder ($CASROOT). Additional test folders can be added to the test system by defining environment variable *CSF_TestScriptsPath*. This should be list of paths separated by semicolons (*;*) on Windows -or colons (*:*) on Linux or Mac. Upon DRAW launch, path to tests subfolder of OCCT is added at the end of this variable automatically. +or colons (*:*) on Linux or Mac. Upon DRAW launch, path to *tests* subfolder of OCCT is added at the end of this variable automatically. Each test folder is expected to contain: - * Optional file parse.rules defining patterns for interpretation of test results, common for all groups in this folder + * Optional file *parse.rules* defining patterns for interpretation of test results, common for all groups in this folder * One or several test group directories. Each group directory contains: @@ -304,15 +306,15 @@ The test group may contain *parse.rules* file. This file defines patterns used f Each line in the file should specify a status (single word), followed by a regular expression delimited by slashes (*/*) that will be matched against lines in the test output log to check if it corresponds to this status. -The regular expressions support a subset of the Perl *re* syntax. See also Perl regular expressions. +The regular expressions should follow Tcl syntax, with special exception that "\b" is considered as word limit (Perl-style), in addition to "\y" used in Tcl. The rest of the line can contain a comment message, which will be added to the test report when this status is detected. Example: ~~~~~ - FAILED /\\b[Ee]xception\\b/ exception - FAILED /\\bError\\b/ error + FAILED /\b[Ee]xception\b/ exception + FAILED /\bError\b/ error SKIPPED /Cannot open file for reading/ data file is missing SKIPPED /Could not read file .*, abandon/ data file is missing ~~~~~ @@ -559,6 +561,7 @@ Other Tcl variables defined during the test execution are: In order to ensure that the test works as expected in different environments, observe the following additional rules: * Avoid using external commands such as *grep, rm,* etc., as these commands can be absent on another system (e.g. on Windows); use facilities provided by Tcl instead. * Do not put call to *locate_data_file* in catch statement – this can prevent correct interpretation of the missing data file by the test system. +* Do not use commands *decho* and *dlog* in the test script, to avoid interference with use of these commands by the test system. @subsection testmanual_3_5 Interpretation of test results @@ -566,8 +569,8 @@ The result of the test is evaluated by checking its output against patterns defi The OCCT test system recognizes five statuses of the test execution: * SKIPPED: reported if a line matching SKIPPED pattern is found (prior to any FAILED pattern). This indicates that the test cannot be run in the current environment; the most typical case is the absence of the required data file. -* FAILED: reported if a line matching pattern with status FAILED is found (unless it is masked by the preceding IGNORE pattern or a TODO statement), or if message TEST COMPLETED is not found at the end. This indicates that the test has produced a bad or unexpected result, and usually means a regression. -* BAD: reported if the test script output contains one or several TODO statements and the corresponding number of matching lines in the log. This indicates a known problem . The lines matching TODO statements are not checked against other patterns and thus will not cause a FAILED status. +* FAILED: reported if a line matching pattern with status FAILED is found (unless it is masked by the preceding IGNORE pattern or a TODO or REQUIRED statement), or if message TEST COMPLETED or at least one of REQUIRED patterns is not found. This indicates that the test has produced a bad or unexpected result, and usually means a regression. +* BAD: reported if the test script output contains one or several TODO statements and the corresponding number of matching lines in the log. This indicates a known problem. The lines matching TODO statements are not checked against other patterns and thus will not cause a FAILED status. * IMPROVEMENT: reported if the test script output contains a TODO statement for which no corresponding line is found. This is a possible indication of improvement (a known problem has disappeared). * OK: reported if none of the above statuses have been assigned. This means that the test has passed without problems. @@ -587,7 +590,7 @@ puts "TODO BugNumber ListOfPlatforms: RegularExpression" Here: * *BugNumber* is the bug ID in the tracker. For example: #12345. -* *ListOfPlatforms* is a list of platforms, at which the bug is reproduced (e.g. Mandriva2008, Windows or All). Note that the platform name is custom for the OCCT test system; it corresponds to the value of environment variable *os_type* defined in DRAW. +* *ListOfPlatforms* is a list of platforms, at which the bug is reproduced (Linux, Windows, MacOS, or All). Note that the platform name is custom for the OCCT test system; it corresponds to the value of environment variable *os_type* defined in DRAW. Example: ~~~~~ @@ -616,7 +619,27 @@ puts "TODO OCC22817 All: \\*\\* Exception \\*\\*" puts "TODO OCC22817 All: TEST INCOMPLETE" ~~~~~ +@subsection testmanual_3_7 Marking required output +To check expected output which must be obtained as a result of a test for it to be considered correct, add REQUIRED statement for each specific message. +For that, the following statement should be added to such a test script: + +~~~~~ +puts "REQUIRED ListOfPlatforms: RegularExpression" +~~~~~ + +Here *ListOfPlatforms* and *RegularExpression* have the same meaning as in TODO statements described above. + +The REQUIRED statament can also be used to mask message that would normally be interpreted as error (according to rules defined in *parse.rules*) but should not be considered as such within current test. + +Example: +~~~~~ +puts "TODO REQUIRED Linux: Faulty shapes in variables faulty_1 to faulty_5" +~~~~~ + +This statement notifies test system that errors reported by *checkshape* command are expected in that test case, and test should be considered as OK if this message appears, despite of presence of general rule stating that 'Faulty' signals failure. + +If output does not contain required statement, test case will be marked as FAILED. @section testmanual_4 Advanced Use diff --git a/src/DrawResources/TestCommands.tcl b/src/DrawResources/TestCommands.tcl index 2f0840d472..7fea9b3648 100644 --- a/src/DrawResources/TestCommands.tcl +++ b/src/DrawResources/TestCommands.tcl @@ -63,37 +63,37 @@ proc test {group grid casename {args {}}} { set arg [lindex $args $narg] # if echo specified as "-echo", convert it to bool if { $arg == "-echo" || $arg == "1" } { - set echo t - continue + set echo t + continue } # output log file if { $arg == "-outfile" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set logfile [lindex $args $narg] - } else { - error "Option -outfile requires argument" - } - continue + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set logfile [lindex $args $narg] + } else { + error "Option -outfile requires argument" + } + continue } # allow overwrite existing log if { $arg == "-overwrite" } { - set overwrite 1 - continue + set overwrite 1 + continue } # sound signal at the end of the test if { $arg == "-beep" } { - set signal t - continue + set signal t + continue } # if errors specified as "-errors", convert it to bool if { $arg == "-errors" } { - set errors t - continue + set errors t + continue } # unsupported option @@ -111,20 +111,20 @@ proc test {group grid casename {args {}}} { error "Error: Specified log file \"$logfile\" exists; please remove it before running test or use -overwrite option" } if {$logfile != ""} { - if {[file extension $logfile] == ".html"} { - if {[regexp {vdump ([^\s\n]+)} $html_log dump snapshot]} { - catch {file copy -force $snapshot [file rootname $logfile][file extension $snapshot]} + if {[file extension $logfile] == ".html"} { + if {[regexp {vdump ([^\s\n]+)} $html_log dump snapshot]} { + catch {file copy -force $snapshot [file rootname $logfile][file extension $snapshot]} + } + _log_html $logfile $html_log "Test $group $grid $casename" + } else { + _log_save $logfile "[dlog get]\n$summary" "Test $group $grid $casename" } - _log_html $logfile $html_log "Test $group $grid $casename" - } else { - _log_save $logfile "[dlog get]\n$summary" "Test $group $grid $casename" - } } } # play sound signal at the end of test if {$signal} { - puts "\7\7\7\7" + puts "\7\7\7\7" } return } @@ -152,7 +152,7 @@ proc testgrid {args} { # check that environment variable defining paths to test scripts is defined if { ! [info exists env(CSF_TestScriptsPath)] || - [llength $env(CSF_TestScriptsPath)] <= 0 } { + [llength $env(CSF_TestScriptsPath)] <= 0 } { error "Error: Environment variable CSF_TestScriptsPath is not defined" } @@ -164,100 +164,100 @@ proc testgrid {args} { set xmlfile "" set signal 0 for {set narg 0} {$narg < [llength $args]} {incr narg} { - set arg [lindex $args $narg] + set arg [lindex $args $narg] - # parallel execution - if { $arg == "-parallel" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set parallel [expr [lindex $args $narg]] - } else { - error "Option -parallel requires argument" - } - continue - } + # parallel execution + if { $arg == "-parallel" } { + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set parallel [expr [lindex $args $narg]] + } else { + error "Option -parallel requires argument" + } + continue + } - # refresh logs time - if { $arg == "-refresh" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set refresh [expr [lindex $args $narg]] - } else { - error "Option -refresh requires argument" - } - continue - } + # refresh logs time + if { $arg == "-refresh" } { + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set refresh [expr [lindex $args $narg]] + } else { + error "Option -refresh requires argument" + } + continue + } - # output directory - if { $arg == "-outdir" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set logdir [lindex $args $narg] - } else { - error "Option -outdir requires argument" - } - continue - } + # output directory + if { $arg == "-outdir" } { + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set logdir [lindex $args $narg] + } else { + error "Option -outdir requires argument" + } + continue + } - # allow overwrite logs - if { $arg == "-overwrite" } { - set overwrite 1 - continue - } + # allow overwrite logs + if { $arg == "-overwrite" } { + set overwrite 1 + continue + } - # refresh logs time - if { $arg == "-xml" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set xmlfile [lindex $args $narg] - } - if { $xmlfile == "" } { - set xmlfile TESTS-summary.xml - } - continue - } + # refresh logs time + if { $arg == "-xml" } { + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set xmlfile [lindex $args $narg] + } + if { $xmlfile == "" } { + set xmlfile TESTS-summary.xml + } + continue + } - # sound signal at the end of the test - if { $arg == "-beep" } { - set signal t - continue - } + # sound signal at the end of the test + if { $arg == "-beep" } { + set signal t + continue + } - # unsupported option - if { [regexp {^-} $arg] } { - error "Error: unsupported option \"$arg\"" - } + # unsupported option + if { [regexp {^-} $arg] } { + error "Error: unsupported option \"$arg\"" + } - # treat arguments not recognized as options as group and grid names - if { ! [info exists groupmask] } { - set groupmask [split $arg ,] - } elseif { ! [info exists gridmask] } { - set gridmask [split $arg ,] - } elseif { ! [info exists casemask] } { - set casemask [split $arg ,] - } else { - error "Error: cannot interpret argument $narg ($arg)" - } + # treat arguments not recognized as options as group and grid names + if { ! [info exists groupmask] } { + set groupmask [split $arg ,] + } elseif { ! [info exists gridmask] } { + set gridmask [split $arg ,] + } elseif { ! [info exists casemask] } { + set casemask [split $arg ,] + } else { + error "Error: cannot interpret argument $narg ($arg)" + } } # check that target log directory is empty or does not exist set logdir [file normalize [string trim $logdir]] if { $logdir == "" } { - # if specified logdir is empty string, generate unique name like + # if specified logdir is empty string, generate unique name like # results/_ set prefix "" if { ! [catch {exec git branch} gitout] && [regexp {[*] ([\w]+)} $gitout res branch] } { set prefix "${branch}_" } - set logdir "results/${prefix}[clock format [clock seconds] -format {%Y-%m-%dT%H%M}]" - set logdir [file normalize $logdir] + set logdir "results/${prefix}[clock format [clock seconds] -format {%Y-%m-%dT%H%M}]" + set logdir [file normalize $logdir] } if { [file isdirectory $logdir] && ! $overwrite && ! [catch {glob -directory $logdir *}] } { - error "Error: Specified log directory \"$logdir\" is not empty; please clean it before running tests" + error "Error: Specified log directory \"$logdir\" is not empty; please clean it before running tests" } if { [catch {file mkdir $logdir}] || ! [file writable $logdir] } { - error "Error: Cannot create directory \"$logdir\", or it is not writable" + error "Error: Cannot create directory \"$logdir\", or it is not writable" } # masks for search of test groups, grids, and cases @@ -279,99 +279,99 @@ proc testgrid {args} { # iterate by all script paths foreach dir [lsort -unique [_split_path $env(CSF_TestScriptsPath)]] { - # protection against empty paths - set dir [string trim $dir] - if { $dir == "" } { continue } + # protection against empty paths + set dir [string trim $dir] + if { $dir == "" } { continue } - if { $_tests_verbose > 0 } { _log_and_puts log "Examining tests directory $dir" } + if { $_tests_verbose > 0 } { _log_and_puts log "Examining tests directory $dir" } # check that directory exists if { ! [file isdirectory $dir] } { _log_and_puts log "Warning: directory $dir listed in CSF_TestScriptsPath does not exist, skipped" - continue + continue } - # search all directories in the current dir with specified mask - if [catch {glob -directory $dir -tail -types d {*}$groupmask} groups] { continue } + # search all directories in the current dir with specified mask + if [catch {glob -directory $dir -tail -types d {*}$groupmask} groups] { continue } - # iterate by groups - if { $_tests_verbose > 0 } { _log_and_puts log "Groups to be executed: $groups" } - foreach group [lsort -dictionary $groups] { - if { $_tests_verbose > 0 } { _log_and_puts log "Examining group directory $group" } + # iterate by groups + if { $_tests_verbose > 0 } { _log_and_puts log "Groups to be executed: $groups" } + foreach group [lsort -dictionary $groups] { + if { $_tests_verbose > 0 } { _log_and_puts log "Examining group directory $group" } - # file grids.list must exist: it defines sequence of grids in the group + # file grids.list must exist: it defines sequence of grids in the group if { ! [file exists $dir/$group/grids.list] } { - _log_and_puts log "Warning: directory $dir/$group does not contain file grids.list, skipped" - continue - } + _log_and_puts log "Warning: directory $dir/$group does not contain file grids.list, skipped" + continue + } - # read grids.list file and make a list of grids to be executed - set gridlist {} - set fd [open $dir/$group/grids.list] - set nline 0 - while { [gets $fd line] >= 0 } { - incr nline + # read grids.list file and make a list of grids to be executed + set gridlist {} + set fd [open $dir/$group/grids.list] + set nline 0 + while { [gets $fd line] >= 0 } { + incr nline - # skip comments and empty lines - if { [regexp "\[ \t\]*\#.*" $line] } { continue } - if { [string trim $line] == "" } { continue } + # skip comments and empty lines + if { [regexp "\[ \t\]*\#.*" $line] } { continue } + if { [string trim $line] == "" } { continue } - # get grid id and name - if { ! [regexp "^\(\[0-9\]+\)\[ \t\]*\(\[A-Za-z0-9_.-\]+\)\$" $line res gridid grid] } { - _log_and_puts log "Warning: cannot recognize line $nline in file $dir/$group/grids.list as \"gridid gridname\"; ignored" - continue - } - - # check that grid fits into the specified mask + # get grid id and name + if { ! [regexp "^\(\[0-9\]+\)\[ \t\]*\(\[A-Za-z0-9_.-\]+\)\$" $line res gridid grid] } { + _log_and_puts log "Warning: cannot recognize line $nline in file $dir/$group/grids.list as \"gridid gridname\"; ignored" + continue + } + + # check that grid fits into the specified mask foreach mask $gridmask { - if { $mask == $gridid || [string match $mask $grid] } { - lappend gridlist $grid + if { $mask == $gridid || [string match $mask $grid] } { + lappend gridlist $grid } - } - } - close $fd - - # iterate by all grids - foreach grid $gridlist { + } + } + close $fd - # check if this grid is aliased to another one - set griddir $dir/$group/$grid - if { [file exists $griddir/cases.list] } { - set fd [open $griddir/cases.list] - if { [gets $fd line] >= 0 } { - set griddir [file normalize $dir/$group/$grid/[string trim $line]] - } - close $fd - } + # iterate by all grids + foreach grid $gridlist { - # check if grid directory actually exists - if { ! [file isdirectory $griddir] } { - _log_and_puts log "Error: tests directory for grid $grid ($griddir) is missing; skipped" - continue - } + # check if this grid is aliased to another one + set griddir $dir/$group/$grid + if { [file exists $griddir/cases.list] } { + set fd [open $griddir/cases.list] + if { [gets $fd line] >= 0 } { + set griddir [file normalize $dir/$group/$grid/[string trim $line]] + } + close $fd + } - # create directory for logging test results - if { $logdir != "" } { file mkdir $logdir/$group/$grid } + # check if grid directory actually exists + if { ! [file isdirectory $griddir] } { + _log_and_puts log "Error: tests directory for grid $grid ($griddir) is missing; skipped" + continue + } - # iterate by all tests in the grid directory - if { [catch {glob -directory $griddir -type f {*}$casemask} testfiles] } { continue } - foreach casefile [lsort -dictionary $testfiles] { - # filter out files with reserved names - set casename [file tail $casefile] - if { $casename == "begin" || $casename == "end" || + # create directory for logging test results + if { $logdir != "" } { file mkdir $logdir/$group/$grid } + + # iterate by all tests in the grid directory + if { [catch {glob -directory $griddir -type f {*}$casemask} testfiles] } { continue } + foreach casefile [lsort -dictionary $testfiles] { + # filter out files with reserved names + set casename [file tail $casefile] + if { $casename == "begin" || $casename == "end" || $casename == "parse.rules" } { - continue + continue } - lappend tests_list [list $dir $group $grid $casename $casefile] - } - } - } + lappend tests_list [list $dir $group $grid $casename $casefile] + } + } + } } if { [llength $tests_list] < 1 } { - error "Error: no tests are found, check you input arguments and variable CSF_TestScriptsPath!" + error "Error: no tests are found, check you input arguments and variable CSF_TestScriptsPath!" } else { - puts "Running tests (total [llength $tests_list] test cases)..." + puts "Running tests (total [llength $tests_list] test cases)..." } ###################################################### @@ -385,7 +385,7 @@ proc testgrid {args} { catch {lappend log "DRAW build:\n[dversion]" } lappend log "Environment:" foreach envar [lsort [array names env]] { - lappend log "$envar=\"$env($envar)\"" + lappend log "$envar=\"$env($envar)\"" } lappend log "" @@ -395,21 +395,21 @@ proc testgrid {args} { # if parallel execution is requested, allocate thread pool if { $parallel > 0 } { - if { ! [info exists tcl_platform(threaded)] || [catch {package require Thread}] } { - _log_and_puts log "Warning: Tcl package Thread is not available, running in sequential mode" - set parallel 0 - } else { - set worker [tpool::create -minworkers $parallel -maxworkers $parallel] - # suspend the pool until all jobs are posted, to prevent blocking of the process - # of starting / processing jobs by running threads - catch {tpool::suspend $worker} - if { $_tests_verbose > 0 } { _log_and_puts log "Executing tests in (up to) $parallel threads" } + if { ! [info exists tcl_platform(threaded)] || [catch {package require Thread}] } { + _log_and_puts log "Warning: Tcl package Thread is not available, running in sequential mode" + set parallel 0 + } else { + set worker [tpool::create -minworkers $parallel -maxworkers $parallel] + # suspend the pool until all jobs are posted, to prevent blocking of the process + # of starting / processing jobs by running threads + catch {tpool::suspend $worker} + if { $_tests_verbose > 0 } { _log_and_puts log "Executing tests in (up to) $parallel threads" } # limit number of jobs in the queue by reasonable value # to prevent slowdown due to unnecessary queue processing set nbpooled 0 set nbpooled_max [expr 10 * $parallel] set nbpooled_ok [expr 5 * $parallel] - } + } } # start test cases @@ -421,81 +421,81 @@ proc testgrid {args} { break } - set dir [lindex $test_def 0] - set group [lindex $test_def 1] - set grid [lindex $test_def 2] - set casename [lindex $test_def 3] - set casefile [lindex $test_def 4] + set dir [lindex $test_def 0] + set group [lindex $test_def 1] + set grid [lindex $test_def 2] + set casename [lindex $test_def 3] + set casefile [lindex $test_def 4] - # command to set tests for generation of image in results directory - set imgdir_cmd "" - if { $logdir != "" } { set imgdir_cmd "set imagedir $logdir/$group/$grid" } + # command to set tests for generation of image in results directory + set imgdir_cmd "" + if { $logdir != "" } { set imgdir_cmd "set imagedir $logdir/$group/$grid" } - # prepare command file for running test case in separate instance of DRAW - set fd_cmd [open $logdir/$group/$grid/${casename}.tcl w] - puts $fd_cmd "$imgdir_cmd" - puts $fd_cmd "set test_image $casename" - puts $fd_cmd "_run_test $dir $group $grid $casefile t" + # prepare command file for running test case in separate instance of DRAW + set fd_cmd [open $logdir/$group/$grid/${casename}.tcl w] + puts $fd_cmd "$imgdir_cmd" + puts $fd_cmd "set test_image $casename" + puts $fd_cmd "_run_test $dir $group $grid $casefile t" - # use dlog command to obtain complete output of the test when it is absent (i.e. since OCCT 6.6.0) - # note: this is not needed if echo is set to 1 in call to _run_test above - if { ! [catch {dlog get}] } { - puts $fd_cmd "puts \[dlog get\]" - } else { - # else try to use old-style QA_ variables to get more output... - set env(QA_DUMP) 1 - set env(QA_DUP) 1 - set env(QA_print_command) 1 - } + # use dlog command to obtain complete output of the test when it is absent (i.e. since OCCT 6.6.0) + # note: this is not needed if echo is set to 1 in call to _run_test above + if { ! [catch {dlog get}] } { + puts $fd_cmd "puts \[dlog get\]" + } else { + # else try to use old-style QA_ variables to get more output... + set env(QA_DUMP) 1 + set env(QA_DUP) 1 + set env(QA_print_command) 1 + } - # final 'exit' is needed when running on Linux under VirtualGl - puts $fd_cmd "exit" - close $fd_cmd + # final 'exit' is needed when running on Linux under VirtualGl + puts $fd_cmd "exit" + close $fd_cmd # commant to run DRAW with a command file; # note that empty string is passed as standard input to avoid possible # hang-ups due to waiting for stdin of the launching process - set command "exec <<{} DRAWEXE -f $logdir/$group/$grid/${casename}.tcl" + set command "exec <<{} DRAWEXE -f $logdir/$group/$grid/${casename}.tcl" - # alternative method to run without temporary file; disabled as it needs too many backslashes -# else { -# set command "exec <<\"\" DRAWEXE -c $imgdir_cmd\\\; set test_image $casename\\\; \ -# _run_test $dir $group $grid $casefile\\\; \ -# puts \\\[dlog get\\\]\\\; exit" -# } + # alternative method to run without temporary file; disabled as it needs too many backslashes + # else { + # set command "exec <<\"\" DRAWEXE -c $imgdir_cmd\\\; set test_image $casename\\\; \ + # _run_test $dir $group $grid $casefile\\\; \ + # puts \\\[dlog get\\\]\\\; exit" + # } - # run test case, either in parallel or sequentially - if { $parallel > 0 } { - # parallel execution - set job [tpool::post -nowait $worker "catch \"$command\" output; return \$output"] - set job_def($job) [list $logdir $dir $group $grid $casename] + # run test case, either in parallel or sequentially + if { $parallel > 0 } { + # parallel execution + set job [tpool::post -nowait $worker "catch \"$command\" output; return \$output"] + set job_def($job) [list $logdir $dir $group $grid $casename] incr nbpooled if { $nbpooled > $nbpooled_max } { _testgrid_process_jobs $worker $nbpooled_ok } - } else { - # sequential execution - catch {eval $command} output - _log_test_case $output $logdir $dir $group $grid $casename log + } else { + # sequential execution + catch {eval $command} output + _log_test_case $output $logdir $dir $group $grid $casename log - # update summary log with requested period - if { $logdir != "" && $refresh > 0 && [expr [clock seconds] - $refresh_timer > $refresh] } { - # update and dump summary - _log_summarize $logdir $log - set refresh_timer [clock seconds] - } - } + # update summary log with requested period + if { $logdir != "" && $refresh > 0 && [expr [clock seconds] - $refresh_timer > $refresh] } { + # update and dump summary + _log_summarize $logdir $log + set refresh_timer [clock seconds] + } + } } # get results of started threads if { $parallel > 0 } { _testgrid_process_jobs $worker - # release thread pool + # release thread pool if { $nbpooled > 0 } { - tpool::cancel $worker [array names job_def] + tpool::cancel $worker [array names job_def] } catch {tpool::resume $worker} - tpool::release $worker + tpool::release $worker } uplevel dchrono _timer stop @@ -512,19 +512,19 @@ proc testgrid {args} { _log_summarize $logdir $log $time if { $logdir != "" } { - puts "Detailed logs are saved in $logdir" + puts "Detailed logs are saved in $logdir" } if { $logdir != "" && $xmlfile != "" } { - # XML output file is assumed relative to log dir unless it is absolute - if { [ file pathtype $xmlfile] == "relative" } { - set xmlfile [file normalize $logdir/$xmlfile] - } - _log_xml_summary $logdir $xmlfile $log 0 - puts "XML summary is saved to $xmlfile" + # XML output file is assumed relative to log dir unless it is absolute + if { [ file pathtype $xmlfile] == "relative" } { + set xmlfile [file normalize $logdir/$xmlfile] + } + _log_xml_summary $logdir $xmlfile $log 0 + puts "XML summary is saved to $xmlfile" } # play sound signal at the end of test if {$signal} { - puts "\7\7\7\7" + puts "\7\7\7\7" } return } @@ -540,7 +540,7 @@ proc testsummarize {dir} { global _test_case_regexp if { ! [file isdirectory $dir] } { - error "Error: \"$dir\" is not a directory" + error "Error: \"$dir\" is not a directory" } # get summary statements from all test cases in one log @@ -553,15 +553,15 @@ proc testsummarize {dir} { set file [file join $dir $grid $caselog] set nbfound 0 set fd [open $file r] - while { [gets $fd line] >= 0 } { - if { [regexp $_test_case_regexp $line res grp grd cas status message] } { + while { [gets $fd line] >= 0 } { + if { [regexp $_test_case_regexp $line res grp grd cas status message] } { if { "[file join $grid $caselog]" != "[file join $grp $grd ${cas}.log]" } { puts "Error: $file contains status line for another test case ($line)" } - lappend log $line - incr nbfound - } - } + lappend log $line + incr nbfound + } + } close $fd if { $nbfound != 1 } { @@ -591,13 +591,12 @@ help testdiff { 1 - output only differences 2 - output also list of logs and directories present in one of dirs only 3 - (default) output also progress messages - -highlight_percent value: highlight considerable (>value in %) deviations of CPU and memory (default value is 5%) } proc testdiff {dir1 dir2 args} { if { "$dir1" == "$dir2" } { - error "Input directories are the same" + error "Input directories are the same" } ###################################################### @@ -609,61 +608,63 @@ proc testdiff {dir1 dir2 args} { set basename "" set status "same" set verbose 3 - set highlight_percent 5 + set highlight_percent 5 for {set narg 0} {$narg < [llength $args]} {incr narg} { - set arg [lindex $args $narg] + set arg [lindex $args $narg] - # log file name - if { $arg == "-save" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set logfile [lindex $args $narg] - } else { - error "Error: Option -save must be followed by log file name" - } - continue - } + # log file name + if { $arg == "-save" } { + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set logfile [lindex $args $narg] + } else { + error "Error: Option -save must be followed by log file name" + } + continue + } - # status filter - if { $arg == "-status" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set status [lindex $args $narg] - } else { set status "" } - if { "$status" != "same" && "$status" != "all" && "$status" != "ok" } { - error "Error: Option -status must be followed by one of \"same\", \"all\", or \"ok\"" - } - continue - } + # status filter + if { $arg == "-status" } { + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set status [lindex $args $narg] + } else { + set status "" + } + if { "$status" != "same" && "$status" != "all" && "$status" != "ok" } { + error "Error: Option -status must be followed by one of \"same\", \"all\", or \"ok\"" + } + continue + } - # verbose level - if { $arg == "-verbose" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set verbose [expr [lindex $args $narg]] - } else { - error "Error: Option -verbose must be followed by integer verbose level" - } - continue - } - - # highlight_percent - if { $arg == "-highlight_percent" } { - incr narg - if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { - set highlight_percent [expr [lindex $args $narg]] - } else { - error "Error: Option -highlight_percent must be followed by integer value" - } - continue - } - - if { [regexp {^-} $arg] } { - error "Error: unsupported option \"$arg\"" - } + # verbose level + if { $arg == "-verbose" } { + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set verbose [expr [lindex $args $narg]] + } else { + error "Error: Option -verbose must be followed by integer verbose level" + } + continue + } + + # highlight_percent + if { $arg == "-highlight_percent" } { + incr narg + if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } { + set highlight_percent [expr [lindex $args $narg]] + } else { + error "Error: Option -highlight_percent must be followed by integer value" + } + continue + } + + if { [regexp {^-} $arg] } { + error "Error: unsupported option \"$arg\"" + } # non-option arguments form a subdirectory path - set basename [file join $basename $arg] + set basename [file join $basename $arg] } # run diff procedure (recursive) @@ -749,8 +750,8 @@ proc testfile {filelist} { # add the file to the registry set names($name_lower) $file lappend sizes($size) $file - } - } + } + } } if { [llength $filelist] <= 0 } { return } @@ -782,9 +783,9 @@ proc testfile {filelist} { set found f foreach other $sizes($size) { if { ! [_diff_files $file $other] } { - puts "$file: OK: the same file is already present under name [file tail $other]\n--> $other" - set found t - break + puts "$file: OK: the same file is already present under name [file tail $other]\n--> $other" + set found t + break } } if { $found } { continue } @@ -850,35 +851,35 @@ proc locate_data_file {filename} { set scriptfile [info script] if { $scriptfile != "" } { set path [file join [file dirname $scriptfile] data $filename] - if { [file exists $path] } { - return [file normalize $path] - } + if { [file exists $path] } { + return [file normalize $path] + } } # check sub-directories in paths indicated by CSF_TestDataPath if { [info exists env(CSF_TestDataPath)] } { - foreach dir [_split_path $env(CSF_TestDataPath)] { - while {[llength $dir] != 0} { - set name [lindex $dir 0] - set dir [lrange $dir 1 end] + foreach dir [_split_path $env(CSF_TestDataPath)] { + while {[llength $dir] != 0} { + set name [lindex $dir 0] + set dir [lrange $dir 1 end] # skip directories starting with dot if { [regexp {^[.]} $name] } { continue } - if { [file exists $name/$filename] } { - return [file normalize $name/$filename] - } - eval lappend dir [glob -nocomplain -directory $name -type d *] - } - } + if { [file exists $name/$filename] } { + return [file normalize $name/$filename] + } + eval lappend dir [glob -nocomplain -directory $name -type d *] + } + } } # check current datadir if { [file exists [uplevel datadir]/$filename] } { - return [file normalize [uplevel datadir]/$filename] + return [file normalize [uplevel datadir]/$filename] } # raise error error [join [list "File $filename could not be found" \ - "(should be in paths indicated by CSF_TestDataPath environment variable, " \ + "(should be in paths indicated by CSF_TestDataPath environment variable, " \ "or in subfolder data in the script directory)"] "\n"] } @@ -903,14 +904,14 @@ proc _get_test {group grid casename _dir _gridname _casefile} { # iterate by all script paths foreach dir [_split_path $env(CSF_TestScriptsPath)] { - # protection against empty paths - set dir [string trim $dir] - if { $dir == "" } { continue } + # protection against empty paths + set dir [string trim $dir] + if { $dir == "" } { continue } # check that directory exists if { ! [file isdirectory $dir] } { puts "Warning: directory $dir listed in CSF_TestScriptsPath does not exist, skipped" - continue + continue } # check if test group with given name exists in this dir @@ -930,8 +931,8 @@ proc _get_test {group grid casename _dir _gridname _casefile} { } } close $fd - } - } + } + } if { ! [file isdirectory $dir/$group/$gridname] } { continue } # get actual file name of the script; stop if it cannot be found @@ -943,8 +944,8 @@ proc _get_test {group grid casename _dir _gridname _casefile} { if { [gets $fd line] >= 0 } { set casefile [file normalize $dir/$group/$gridname/[string trim $line]/$casename] } - close $fd - } + close $fd + } } if { [file exists $casefile] } { # normal return @@ -954,7 +955,7 @@ proc _get_test {group grid casename _dir _gridname _casefile} { # coming here means specified test is not found; report error error [join [list "Error: test case $group / $grid / $casename is not found in paths listed in variable" \ - "CSF_TestScriptsPath (current value is \"$env(CSF_TestScriptsPath)\")"] "\n"] + "CSF_TestScriptsPath (current value is \"$env(CSF_TestScriptsPath)\")"] "\n"] } # Internal procedure to run test case indicated by base directory, @@ -971,42 +972,42 @@ proc _run_test {scriptsdir group gridname casefile echo} { # enable commands logging; switch to old-style mode if dlog command is not present set dlog_exists 1 if { [catch {dlog reset}] } { - set dlog_exists 0 + set dlog_exists 0 } elseif { $echo } { decho on } else { - dlog reset - dlog on - rename puts puts-saved - proc puts args { - global _tests_verbose + dlog reset + dlog on + rename puts puts-saved + proc puts args { + global _tests_verbose - # log only output to stdout and stderr, not to file! - if {[llength $args] > 1} { - set optarg [lindex $args end-1] - if { $optarg == "stdout" || $optarg == "stderr" || $optarg == "-newline" } { - dlog add [lindex $args end] - } else { - eval puts-saved $args - } - } else { - dlog add [lindex $args end] - } - } + # log only output to stdout and stderr, not to file! + if {[llength $args] > 1} { + set optarg [lindex $args end-1] + if { $optarg == "stdout" || $optarg == "stderr" || $optarg == "-newline" } { + dlog add [lindex $args end] + } else { + eval puts-saved $args + } + } else { + dlog add [lindex $args end] + } + } } # evaluate test case set tmp_imagedir 0 if [catch { # set variables identifying test case - uplevel set casename [file tail $casefile] - uplevel set groupname $group - uplevel set gridname $gridname - uplevel set dirname $scriptsdir + uplevel set casename [file tail $casefile] + uplevel set groupname $group + uplevel set gridname $gridname + uplevel set dirname $scriptsdir - # set path for saving of log and images (if not yet set) to temp dir - if { ! [uplevel info exists imagedir] } { - uplevel set test_image \$casename + # set path for saving of log and images (if not yet set) to temp dir + if { ! [uplevel info exists imagedir] } { + uplevel set test_image \$casename # create subdirectory in temp named after group and grid with timestamp set rootlogdir [_get_temp_dir] @@ -1016,48 +1017,48 @@ proc _run_test {scriptsdir group gridname casefile echo} { if { [catch {file mkdir $imagedir}] || ! [file writable $imagedir] || ! [catch {glob -directory $imagedir *}] } { -# puts "Warning: Cannot create directory \"$imagedir\", or it is not empty; \"${rootlogdir}\" is used" + # puts "Warning: Cannot create directory \"$imagedir\", or it is not empty; \"${rootlogdir}\" is used" set imagedir $rootlogdir } uplevel set imagedir \"$imagedir\" set tmp_imagedir 1 - } + } - # execute test scripts + # execute test scripts if { [file exists $scriptsdir/$group/begin] } { - puts "Executing $scriptsdir/$group/begin..."; flush stdout - uplevel source $scriptsdir/$group/begin - } - if { [file exists $scriptsdir/$group/$gridname/begin] } { - puts "Executing $scriptsdir/$group/$gridname/begin..."; flush stdout - uplevel source $scriptsdir/$group/$gridname/begin - } - - puts "Executing $casefile..."; flush stdout - uplevel source $casefile - - if { [file exists $scriptsdir/$group/$gridname/end] } { - puts "Executing $scriptsdir/$group/$gridname/end..."; flush stdout - uplevel source $scriptsdir/$group/$gridname/end - } - if { [file exists $scriptsdir/$group/end] } { - puts "Executing $scriptsdir/$group/end..."; flush stdout - uplevel source $scriptsdir/$group/end - } + puts "Executing $scriptsdir/$group/begin..."; flush stdout + uplevel source $scriptsdir/$group/begin + } + if { [file exists $scriptsdir/$group/$gridname/begin] } { + puts "Executing $scriptsdir/$group/$gridname/begin..."; flush stdout + uplevel source $scriptsdir/$group/$gridname/begin + } + + puts "Executing $casefile..."; flush stdout + uplevel source $casefile + + if { [file exists $scriptsdir/$group/$gridname/end] } { + puts "Executing $scriptsdir/$group/$gridname/end..."; flush stdout + uplevel source $scriptsdir/$group/$gridname/end + } + if { [file exists $scriptsdir/$group/end] } { + puts "Executing $scriptsdir/$group/end..."; flush stdout + uplevel source $scriptsdir/$group/end + } } res] { - puts "Tcl Exception: $res" + puts "Tcl Exception: $res" } # stop logging if { $dlog_exists } { if { $echo } { - decho off + decho off } else { rename puts {} - rename puts-saved puts - dlog off - } + rename puts-saved puts + dlog off + } } # stop cpulimit killer if armed by the test @@ -1071,12 +1072,12 @@ proc _run_test {scriptsdir group gridname casefile echo} { uplevel dchrono _timer stop set time [uplevel dchrono _timer show] if { [regexp -nocase {CPU user time:[ \t]*([0-9.e-]+)} $time res cpu_usr] } { - append stats "TOTAL CPU TIME: $cpu_usr sec\n" + append stats "TOTAL CPU TIME: $cpu_usr sec\n" } if { $dlog_exists && ! $echo } { - dlog add $stats + dlog add $stats } else { - puts $stats + puts $stats } # unset global vars @@ -1093,159 +1094,182 @@ proc _check_log {dir group gridname casename errors log {_summary {}} {_html_log set html_log {} set errors_log {} -if [catch { + if [catch { - # load definition of 'bad words' indicating test failure - # note that rules are loaded in the order of decreasing priority (grid - group - common), - # thus grid rules will override group ones - set badwords {} - foreach rulesfile [list $dir/$group/$gridname/parse.rules $dir/$group/parse.rules $dir/parse.rules] { - if [catch {set fd [open $rulesfile r]}] { continue } - while { [gets $fd line] >= 0 } { - # skip comments and empty lines - if { [regexp "\[ \t\]*\#.*" $line] } { continue } - if { [string trim $line] == "" } { continue } - # extract regexp - if { ! [regexp {^([^/]*)/([^/]*)/(.*)$} $line res status rexp comment] } { - puts "Warning: cannot recognize parsing rule \"$line\" in file $rulesfile" - continue - } - set status [string trim $status] - if { $comment != "" } { append status " ([string trim $comment])" } - set rexp [regsub -all {\\b} $rexp {\\y}] ;# convert regexp from Perl to Tcl style - lappend badwords [list $status $rexp] - } - close $fd + # load definition of 'bad words' indicating test failure + # note that rules are loaded in the order of decreasing priority (grid - group - common), + # thus grid rules will override group ones + set badwords {} + foreach rulesfile [list $dir/$group/$gridname/parse.rules $dir/$group/parse.rules $dir/parse.rules] { + if [catch {set fd [open $rulesfile r]}] { continue } + while { [gets $fd line] >= 0 } { + # skip comments and empty lines + if { [regexp "\[ \t\]*\#.*" $line] } { continue } + if { [string trim $line] == "" } { continue } + # extract regexp + if { ! [regexp {^([^/]*)/([^/]*)/(.*)$} $line res status rexp comment] } { + puts "Warning: cannot recognize parsing rule \"$line\" in file $rulesfile" + continue + } + set status [string trim $status] + if { $comment != "" } { append status " ([string trim $comment])" } + set rexp [regsub -all {\\b} $rexp {\\y}] ;# convert regexp from Perl to Tcl style + lappend badwords [list $status $rexp] + } + close $fd + } + if { [llength $badwords] <= 0 } { + puts "Warning: no definition of error indicators found (check files parse.rules)" + } + + # analyse log line-by-line + set todos {} ;# TODO statements + set requs {} ;# REQUIRED statements + set todo_incomplete -1 + set status "" + foreach line [split $log "\n"] { + # check if line defines specific treatment of some messages + if [regexp -nocase {^[ \s]*TODO ([^:]*):(.*)$} $line res platforms pattern] { + if { ! [regexp -nocase {\mAll\M} $platforms] && + ! [regexp -nocase "\\m$env(os_type)\\M" $platforms] } { + lappend html_log [_html_highlight IGNORE $line] + continue ;# TODO statement is for another platform + } + + # record TODOs that mark unstable cases + if { [regexp {[\?]} $platforms] } { + set todos_unstable([llength $todos]) 1 + } + + # convert legacy regexps from Perl to Tcl style + set pattern [regsub -all {\\b} [string trim $pattern] {\\y}] + + # special case: TODO TEST INCOMPLETE + if { [string trim $pattern] == "TEST INCOMPLETE" } { + set todo_incomplete [llength $todos] + } + + lappend todos [list $pattern [llength $html_log] $line] + lappend html_log [_html_highlight BAD $line] + continue + } + if [regexp -nocase {^[ \s]*REQUIRED ([^:]*):[ \s]*(.*)$} $line res platforms pattern] { + if { ! [regexp -nocase {\mAll\M} $platforms] && + ! [regexp -nocase "\\m$env(os_type)\\M" $platforms] } { + lappend html_log [_html_highlight IGNORE $line] + continue ;# REQUIRED statement is for another platform + } + lappend requs [list $pattern [llength $html_log] $line] + lappend html_log [_html_highlight OK $line] + continue + } + + # check for presence of required messages + set ismarked 0 + for {set i 0} {$i < [llength $requs]} {incr i} { + set pattern [lindex $requs $i 0] + if { [regexp $pattern $line] } { + incr required_count($i) + lappend html_log [_html_highlight OK $line] + set ismarked 1 + continue + } + } + if { $ismarked } { + continue + } + + # check for presence of messages indicating test result + foreach bw $badwords { + if { [regexp [lindex $bw 1] $line] } { + # check if this is known bad case + set is_known 0 + for {set i 0} {$i < [llength $todos]} {incr i} { + set pattern [lindex $todos $i 0] + if { [regexp $pattern $line] } { + set is_known 1 + incr todo_count($i) + lappend html_log [_html_highlight BAD $line] + break + } + } + + # if it is not in todo, define status + if { ! $is_known } { + set stat [lindex $bw 0 0] + if {$errors} { + lappend errors_log $line + } + lappend html_log [_html_highlight $stat $line] + if { $status == "" && $stat != "OK" && ! [regexp -nocase {^IGNOR} $stat] } { + set status [lindex $bw 0] + } + } + set ismarked 1 + break + } + } + if { ! $ismarked } { + lappend html_log $line + } + } + + # check for presence of TEST COMPLETED statement + if { $status == "" && ! [regexp {TEST COMPLETED} $log] } { + # check whether absence of TEST COMPLETED is known problem + if { $todo_incomplete >= 0 } { + incr todo_count($todo_incomplete) + } else { + set status "FAILED (no final message is found)" + } + } + + # report test as failed if it doesn't contain required pattern + if { $status == "" } { + for {set i 0} {$i < [llength $requs]} {incr i} { + if { ! [info exists required_count($i)] } { + set linenum [lindex $requs $i 1] + set html_log [lreplace $html_log $linenum $linenum [_html_highlight FAILED [lindex $requs $i 2]]] + set status "FAILED (REQUIRED statement no. [expr $i + 1] is not found)" + } + } + } + + # check declared bad cases and diagnose possible improvement + # (bad case declared but not detected). + # Note that absence of the problem marked by TODO with question mark + # (unstable) is not reported as improvement. + if { $status == "" } { + for {set i 0} {$i < [llength $todos]} {incr i} { + if { ! [info exists todos_unstable($i)] && + (! [info exists todo_count($i)] || $todo_count($i) <= 0) } { + set linenum [lindex $todos $i 1] + set html_log [lreplace $html_log $linenum $linenum [_html_highlight IMPROVEMENT [lindex $todos $i 2]]] + set status "IMPROVEMENT (expected problem TODO no. [expr $i + 1] is not detected)" + break; + } + } + } + + # report test as known bad if at least one of expected problems is found + if { $status == "" && [llength [array names todo_count]] > 0 } { + set status "BAD (known problem)" + } + + # report normal OK + if { $status == "" } {set status "OK" } + + } res] { + set status "FAILED ($res)" } - if { [llength $badwords] <= 0 } { - puts "Warning: no definition of error indicators found (check files parse.rules)" - } - - # analyse log line-by-line - set todos {} - set status "" - foreach line [split $log "\n"] { - # check if line defines specific treatment of some messages - set deb_info [dversion] - if [regexp -nocase {^[ \s]*TODO ([^:]*):(.*)$} $line res platforms pattern] { - if { [regexp {DEBUG_} $platforms] != 1 } { - if { ! [regexp -nocase {\mAll\M} $platforms] && - ! [regexp -nocase "\\m$env(os_type)\\M" $platforms] } { - lappend html_log $line - continue ;# TODO statement is for another platform - } - - # record TODOs that mark unstable cases - if { [regexp {[\?]} $platforms] } { - set todos_unstable([llength $todos]) 1 - } - - lappend todos [regsub -all {\\b} [string trim $pattern] {\\y}] ;# convert regexp from Perl to Tcl style - lappend html_log [_html_highlight BAD $line] - continue - } - - if { [regexp "Debug mode" $deb_info] != 1 && [regexp {DEBUG_} $platforms] == 1 } { - continue - } - - if { [regexp "Debug mode" $deb_info] == 1 && [regexp {DEBUG_} $platforms] == 1 } { - if { ! [regexp -nocase {\mAll\M} $platforms] && - ! [regexp -nocase "\\m$env(os_type)\\M" $platforms] } { - lappend html_log $line - continue ;# TODO statement is for another platform - } - - # record TODOs that mark unstable cases - if { [regexp {[\?]} $platforms] } { - set todos_unstable([llength $todos]) 1 - } - - lappend todos [regsub -all {\\b} [string trim $pattern] {\\y}] ;# convert regexp from Perl to Tcl style - lappend html_log [_html_highlight BAD $line] - continue - } - } - - # check for presence of messages indicating test result - set ismarked 0 - foreach bw $badwords { - if { [regexp [lindex $bw 1] $line] } { - # check if this is known bad case - set is_known 0 - for {set i 0} {$i < [llength $todos]} {incr i} { - if { [regexp [lindex $todos $i] $line] } { - set is_known 1 - incr todo_count($i) - lappend html_log [_html_highlight BAD $line] - break - } - } - - # if it is not in todo, define status - if { ! $is_known } { - set stat [lindex $bw 0 0] - if {$errors} { - lappend errors_log $line - } - lappend html_log [_html_highlight $stat $line] - if { $status == "" && $stat != "OK" && ! [regexp -nocase {^IGNOR} $stat] } { - set status [lindex $bw 0] - } - } - set ismarked 1 - break - } - } - if { ! $ismarked } { - lappend html_log $line - } - } - - # check for presence of TEST COMPLETED statement - if { $status == "" && ! [regexp {TEST COMPLETED} $log] } { - # check whether absence of TEST COMPLETED is known problem - set i [lsearch $todos "TEST INCOMPLETE"] - if { $i >= 0 } { - incr todo_count($i) - } else { - set status "FAILED (no final message is found)" - } - } - - # check declared bad cases and diagnose possible improvement - # (bad case declared but not detected). - # Note that absence of the problem marked by TODO with question mark - # (unstable) is not reported as improvement. - if { $status == "" } { - for {set i 0} {$i < [llength $todos]} {incr i} { - if { ! [info exists todos_unstable($i)] && - (! [info exists todo_count($i)] || $todo_count($i) <= 0) } { - set status "IMPROVEMENT (expected problem TODO no. [expr $i + 1] is not detected)" - break; - } - } - } - - # report test as known bad if at least one of expected problems is found - if { $status == "" && [llength [array names todo_count]] > 0 } { - set status "BAD (known problem)" - } - - # report normal OK - if { $status == "" } {set status "OK" } - -} res] { - set status "FAILED ($res)" -} # put final message _log_and_puts summary "CASE $group $gridname $casename: $status" set summary [join $summary "\n"] if {$errors} { - foreach error $errors_log { - _log_and_puts summary " $error" - } + foreach error $errors_log { + _log_and_puts summary " $error" + } } set html_log "[_html_highlight [lindex $status 0] $summary]\n[join $html_log \n]" } @@ -1253,8 +1277,8 @@ if [catch { # Auxiliary procedure putting message to both cout and log variable (list) proc _log_and_puts {logvar message} { if { $logvar != "" } { - upvar $logvar log - lappend log $message + upvar $logvar log + lappend log $message } puts $message } @@ -1269,8 +1293,8 @@ proc _log_test_case {output logdir dir group grid casename logvar} { # save log to file if { $logdir != "" } { - _log_html $logdir/$group/$grid/$casename.html $html_log "Test $group $grid $casename" - _log_save $logdir/$group/$grid/$casename.log "$output\n$summary" "Test $group $grid $casename" + _log_html $logdir/$group/$grid/$casename.html $html_log "Test $group $grid $casename" + _log_save $logdir/$group/$grid/$casename.log "$output\n$summary" "Test $group $grid $casename" } } @@ -1281,7 +1305,7 @@ proc _log_save {file log {title {}}} { # try to open a file if [catch {set fd [open $file w]} res] { - error "Error saving log file $file: $res" + error "Error saving log file $file: $res" } # dump log and close @@ -1314,7 +1338,7 @@ proc _log_html {file log {title {}}} { # try to open a file if [catch {set fd [open $file w]} res] { - error "Error saving log file $file: $res" + error "Error saving log file $file: $res" } # print header @@ -1328,7 +1352,7 @@ proc _log_html {file log {title {}}} { ${imgbasename}.gif ${imgbasename}.png ${imgbasename}.jpg \ ${imgbasename}_*.gif ${imgbasename}_*.png ${imgbasename}_*.jpg \ ${imgbasename}-*.gif ${imgbasename}-*.png ${imgbasename}-*.jpg]] { - puts $fd "

[file tail $img]

" + puts $fd "

[file tail $img]

" } # print log body, trying to add HTML links to script files on lines like @@ -1351,20 +1375,20 @@ proc _log_html {file log {title {}}} { proc _html_color {status} { # choose a color for the cell according to result if { $status == "OK" } { - return lightgreen + return lightgreen } elseif { [regexp -nocase {^FAIL} $status] } { - return red + return red } elseif { [regexp -nocase {^BAD} $status] } { - return yellow + return yellow } elseif { [regexp -nocase {^IMP} $status] } { - return orange + return orange } elseif { [regexp -nocase {^SKIP} $status] } { - return gray + return gray } elseif { [regexp -nocase {^IGNOR} $status] } { - return gray + return gray } else { - puts "Warning: no color defined for status $status, using red as if FAILED" - return red + puts "Warning: no color defined for status $status, using red as if FAILED" + return red } } @@ -1383,14 +1407,14 @@ proc _log_html_summary {logdir log totals regressions improvements total_time} { # try to open a file and start HTML if [catch {set fd [open $logdir/summary.html w]} res] { - error "Error creating log file: $res" + error "Error creating log file: $res" } # write HRML header, including command to refresh log if still in progress puts $fd "" puts $fd "Tests summary" if { $total_time == "" } { - puts $fd "" + puts $fd "" } puts $fd "" puts $fd "" @@ -1403,45 +1427,45 @@ proc _log_html_summary {logdir log totals regressions improvements total_time} { set legend(SKIPPED) "Test skipped due to lack of data file" puts $fd "

Summary

" foreach nbstat $totals { - set status [lindex $nbstat 1] - if { [info exists legend($status)] } { - set comment $legend($status) - } else { - set comment "User-defined status" - } - puts $fd "" + set status [lindex $nbstat 1] + if { [info exists legend($status)] } { + set comment $legend($status) + } else { + set comment "User-defined status" + } + puts $fd "" } puts $fd "
[lindex $nbstat 0]$status$comment
[lindex $nbstat 0]$status$comment
" # time stamp and elapsed time info if { $total_time != "" } { - puts $fd "

Generated on [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}] on [info hostname]\n

" + puts $fd "

Generated on [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}] on [info hostname]\n

" puts $fd [join [split $total_time "\n"] "

"] } else { - puts $fd "

NOTE: This is intermediate summary; the tests are still running! This page will refresh automatically until tests are finished." + puts $fd "

NOTE: This is intermediate summary; the tests are still running! This page will refresh automatically until tests are finished." } # print regressions and improvements foreach featured [list $regressions $improvements] { - if { [llength $featured] <= 1 } { continue } - set status [string trim [lindex $featured 0] { :}] - puts $fd "

$status

" - puts $fd "" - set groupgrid "" - foreach test [lrange $featured 1 end] { - if { ! [regexp {^(.*)\s+([\w.]+)$} $test res gg name] } { - set gg UNKNOWN - set name "Error building short list; check details" - } - if { $gg != $groupgrid } { - if { $groupgrid != "" } { puts $fd "" } - set groupgrid $gg - puts $fd "" - } - puts $fd "" - } - if { $groupgrid != "" } { puts $fd "" } - puts $fd "
$gg$name
" + if { [llength $featured] <= 1 } { continue } + set status [string trim [lindex $featured 0] { :}] + puts $fd "

$status

" + puts $fd "" + set groupgrid "" + foreach test [lrange $featured 1 end] { + if { ! [regexp {^(.*)\s+([\w.]+)$} $test res gg name] } { + set gg UNKNOWN + set name "Error building short list; check details" + } + if { $gg != $groupgrid } { + if { $groupgrid != "" } { puts $fd "" } + set groupgrid $gg + puts $fd "" + } + puts $fd "" + } + if { $groupgrid != "" } { puts $fd "" } + puts $fd "
$gg$name
" } # put detailed log with TOC @@ -1453,57 +1477,57 @@ proc _log_html_summary {logdir log totals regressions improvements total_time} { set letter {} set body {} foreach line [lsort -dictionary $log] { - # check that the line is case report in the form "CASE group grid name: result (explanation)" - if { ! [regexp $_test_case_regexp $line res grp grd casename result message] } { - continue - } + # check that the line is case report in the form "CASE group grid name: result (explanation)" + if { ! [regexp $_test_case_regexp $line res grp grd casename result message] } { + continue + } - # start new group - if { $grp != $group } { - if { $letter != "" } { lappend body "" } - set letter {} - set group $grp - set grid {} - puts $fd "$group
" - lappend body "

Group $group

" - } + # start new group + if { $grp != $group } { + if { $letter != "" } { lappend body "" } + set letter {} + set group $grp + set grid {} + puts $fd "$group
" + lappend body "

Group $group

" + } - # start new grid - if { $grd != $grid } { - if { $letter != "" } { lappend body "" } - set letter {} - set grid $grd - puts $fd "    $grid
" - lappend body "

Grid $group $grid

" - } + # start new grid + if { $grd != $grid } { + if { $letter != "" } { lappend body "" } + set letter {} + set grid $grd + puts $fd "    $grid
" + lappend body "

Grid $group $grid

" + } - # check if test case name is ; - # if not, set alnum to period "." to recognize non-standard test name - if { ! [regexp {\A([A-Za-z]{1,2})([0-9]{1,2})\Z} $casename res alnum number] && + # check if test case name is ; + # if not, set alnum to period "." to recognize non-standard test name + if { ! [regexp {\A([A-Za-z]{1,2})([0-9]{1,2})\Z} $casename res alnum number] && ! [regexp {\A([A-Za-z0-9]+)_([0-9]+)\Z} $casename res alnum number] } { - set alnum $casename - } + set alnum $casename + } - # start new row when letter changes or for non-standard names - if { $alnum != $letter || $alnum == "." } { - if { $letter != "" } { - lappend body "" - } else { - lappend body "" - } - set letter $alnum - } + # start new row when letter changes or for non-standard names + if { $alnum != $letter || $alnum == "." } { + if { $letter != "" } { + lappend body "" + } else { + lappend body "
" + } + set letter $alnum + } - lappend body "" + lappend body "" } puts $fd "\n[join $body "\n"]
$casename$casename
" # add remaining lines of log as plain text puts $fd "

Plain text messages

\n
"
     foreach line $log {
-	if { ! [regexp $_test_case_regexp $line] } {
-	    puts $fd "$line"
-	}
+        if { ! [regexp $_test_case_regexp $line] } {
+            puts $fd "$line"
+        }
     }
     puts $fd "
" @@ -1522,45 +1546,45 @@ proc _log_summarize {logdir log {total_time {}}} { # classify test cases by status foreach line $loglist { - if { [regexp {^CASE ([^:]*): ([[:alnum:]]+).*$} $line res caseid status] } { - lappend stat($status) $caseid - } + if { [regexp {^CASE ([^:]*): ([[:alnum:]]+).*$} $line res caseid status] } { + lappend stat($status) $caseid + } } set totals {} set improvements {Improvements:} set regressions {Failed:} if { [info exists stat] } { - foreach status [lsort [array names stat]] { - lappend totals [list [llength $stat($status)] $status] + foreach status [lsort [array names stat]] { + lappend totals [list [llength $stat($status)] $status] - # separately count improvements (status starting with IMP) and regressions (all except IMP, OK, BAD, and SKIP) - if { [regexp -nocase {^IMP} $status] } { - eval lappend improvements $stat($status) - } elseif { $status != "OK" && ! [regexp -nocase {^BAD} $status] && ! [regexp -nocase {^SKIP} $status] } { - eval lappend regressions $stat($status) - } - } + # separately count improvements (status starting with IMP) and regressions (all except IMP, OK, BAD, and SKIP) + if { [regexp -nocase {^IMP} $status] } { + eval lappend improvements $stat($status) + } elseif { $status != "OK" && ! [regexp -nocase {^BAD} $status] && ! [regexp -nocase {^SKIP} $status] } { + eval lappend regressions $stat($status) + } + } } # if time is specified, add totals if { $total_time != "" } { - if { [llength $improvements] > 1 } { - _log_and_puts log [join $improvements "\n "] - } - if { [llength $regressions] > 1 } { - _log_and_puts log [join $regressions "\n "] - } - if { [llength $improvements] == 1 && [llength $regressions] == 1 } { - _log_and_puts log "No regressions" - } - _log_and_puts log "Total cases: [join $totals {, }]" - _log_and_puts log $total_time + if { [llength $improvements] > 1 } { + _log_and_puts log [join $improvements "\n "] + } + if { [llength $regressions] > 1 } { + _log_and_puts log [join $regressions "\n "] + } + if { [llength $improvements] == 1 && [llength $regressions] == 1 } { + _log_and_puts log "No regressions" + } + _log_and_puts log "Total cases: [join $totals {, }]" + _log_and_puts log $total_time } # save log to files if { $logdir != "" } { - _log_html_summary $logdir $log $totals $regressions $improvements $total_time - _log_save $logdir/tests.log [join $log "\n"] "Tests summary" + _log_html_summary $logdir $log $totals $regressions $improvements $total_time + _log_save $logdir/tests.log [join $log "\n"] "Tests summary" } return @@ -1581,7 +1605,7 @@ proc _log_xml_summary {logdir filename log include_cout} { # try to open a file and start XML if [catch {set fd [open $filename w]} res] { - error "Error creating XML summary file $filename: $res" + error "Error creating XML summary file $filename: $res" } puts $fd "" puts $fd "" @@ -1593,69 +1617,69 @@ proc _log_xml_summary {logdir filename log include_cout} { # sort log and process it line-by-line set group {} foreach line [lsort -dictionary $log] { - # check that the line is case report in the form "CASE group grid name: result (explanation)" - if { ! [regexp $_test_case_regexp $line res grp grd casename result message] } { - continue - } - set message [string trim $message " \t\r\n()"] + # check that the line is case report in the form "CASE group grid name: result (explanation)" + if { ! [regexp $_test_case_regexp $line res grp grd casename result message] } { + continue + } + set message [string trim $message " \t\r\n()"] - # start new testsuite for each grid - if { $grp != $group || $grd != $grid } { + # start new testsuite for each grid + if { $grp != $group || $grd != $grid } { - # write previous test suite - if [info exists testcases] { eval $cmd_testsuite } + # write previous test suite + if [info exists testcases] { eval $cmd_testsuite } - set testcases {} - set nbtests 0 - set nberr 0 - set nbfail 0 - set nbskip 0 - set time 0. + set testcases {} + set nbtests 0 + set nberr 0 + set nbfail 0 + set nbskip 0 + set time 0. - set group $grp - set grid $grd - } + set group $grp + set grid $grd + } - incr nbtests - - # parse test log and get its CPU time - set testout {} - set add_cpu {} - if { [catch {set fdlog [open $logdir/$group/$grid/${casename}.log r]} ret] } { - puts "Error: cannot open $logdir/$group/$grid/${casename}.log: $ret" - } else { - while { [gets $fdlog logline] >= 0 } { - if { $include_cout } { - append testout "$logline\n" - } - if [regexp -nocase {TOTAL CPU TIME:\s*([\d.]+)\s*sec} $logline res cpu] { - set add_cpu " time=\"$cpu\"" - set time [expr $time + $cpu] - } - } - close $fdlog - } - if { ! $include_cout } { + incr nbtests + + # parse test log and get its CPU time + set testout {} + set add_cpu {} + if { [catch {set fdlog [open $logdir/$group/$grid/${casename}.log r]} ret] } { + puts "Error: cannot open $logdir/$group/$grid/${casename}.log: $ret" + } else { + while { [gets $fdlog logline] >= 0 } { + if { $include_cout } { + append testout "$logline\n" + } + if [regexp -nocase {TOTAL CPU TIME:\s*([\d.]+)\s*sec} $logline res cpu] { + set add_cpu " time=\"$cpu\"" + set time [expr $time + $cpu] + } + } + close $fdlog + } + if { ! $include_cout } { set testout "$line\n" - } + } - # record test case with its output and status - # Mapping is: SKIPPED, BAD, and OK to OK, all other to failure - append testcases "\n \n" - append testcases "\n \n$testout " - if { $result != "OK" } { - if { [regexp -nocase {^SKIP} $result] } { - incr nberr - append testcases "\n " - } elseif { [regexp -nocase {^BAD} $result] } { - incr nbskip - append testcases "\n $message" - } else { - incr nbfail - append testcases "\n " - } - } - append testcases "\n " + # record test case with its output and status + # Mapping is: SKIPPED, BAD, and OK to OK, all other to failure + append testcases "\n \n" + append testcases "\n \n$testout " + if { $result != "OK" } { + if { [regexp -nocase {^SKIP} $result] } { + incr nberr + append testcases "\n " + } elseif { [regexp -nocase {^BAD} $result] } { + incr nbskip + append testcases "\n $message" + } else { + incr nbfail + append testcases "\n " + } + } + append testcases "\n " } # write last test suite @@ -1673,10 +1697,10 @@ proc _tests_platform_def {} { if [info exists env(os_type)] { return } set env(os_type) $tcl_platform(platform) - if { $tcl_platform(os) == "Linux" } { + if { $tcl_platform(os) == "Linux" } { set env(os_type) Linux } - if { $tcl_platform(os) == "Darwin" } { + if { $tcl_platform(os) == "Darwin" } { set env(os_type) MacOS } } @@ -1701,9 +1725,9 @@ proc _path_separator {} { # split path by platform-specific separator if { $tcl_platform(platform) == "windows" } { - return ";" + return ";" } else { - return ":" + return ":" } } @@ -1717,16 +1741,16 @@ proc _list_diff {list1 list2 _in1 _in2 _common} { set in2 {} set common {} foreach item $list1 { - if { [lsearch -exact $list2 $item] >= 0 } { - lappend common $item + if { [lsearch -exact $list2 $item] >= 0 } { + lappend common $item } else { - lappend in1 $item - } + lappend in1 $item + } } foreach item $list2 { - if { [lsearch -exact $common $item] < 0 } { - lappend in2 $item - } + if { [lsearch -exact $common $item] < 0 } { + lappend in2 $item + } } return } @@ -1780,9 +1804,9 @@ proc _test_diff {dir1 dir2 basename status verbose _logvar {_statvar ""}} { } foreach subdir $common { if { "$verbose" > 2 } { - _log_and_puts log "Checking [file join $basename $subdir]" - } - _test_diff $dir1 $dir2 [file join $basename $subdir] $status $verbose log stat + _log_and_puts log "Checking [file join $basename $subdir]" + } + _test_diff $dir1 $dir2 [file join $basename $subdir] $status $verbose log stat } } else { # check log files (only if directory has no subdirs) @@ -1799,59 +1823,59 @@ proc _test_diff {dir1 dir2 basename status verbose _logvar {_statvar ""}} { set gmem2 0 foreach logfile $common { # load two logs - set log1 [_read_file [file join $dir1 $basename $logfile]] - set log2 [_read_file [file join $dir2 $basename $logfile]] + set log1 [_read_file [file join $dir1 $basename $logfile]] + set log2 [_read_file [file join $dir2 $basename $logfile]] set casename [file rootname $logfile] # check execution statuses set status1 UNDEFINED set status2 UNDEFINED - if { ! [regexp {CASE [^:]*:\s*([\w]+)} $log1 res1 status1] || - ! [regexp {CASE [^:]*:\s*([\w]+)} $log2 res2 status2] || - "$status1" != "$status2" } { - _log_and_puts log "STATUS [split $basename /] $casename: $status1 / $status2" + if { ! [regexp {CASE [^:]*:\s*([\w]+)} $log1 res1 status1] || + ! [regexp {CASE [^:]*:\s*([\w]+)} $log2 res2 status2] || + "$status1" != "$status2" } { + _log_and_puts log "STATUS [split $basename /] $casename: $status1 / $status2" # if test statuses are different, further comparison makes - # no sense unless explicitly requested - if { "$status" != "all" } { + # no sense unless explicitly requested + if { "$status" != "all" } { continue - } - } - if { "$status" == "ok" && "$status1" != "OK" } { - continue - } + } + } + if { "$status" == "ok" && "$status1" != "OK" } { + continue + } # check CPU times set cpu1 UNDEFINED set cpu2 UNDEFINED - if { [regexp {TOTAL CPU TIME:\s*([\d.]+)} $log1 res1 cpu1] && - [regexp {TOTAL CPU TIME:\s*([\d.]+)} $log2 res1 cpu2] } { + if { [regexp {TOTAL CPU TIME:\s*([\d.]+)} $log1 res1 cpu1] && + [regexp {TOTAL CPU TIME:\s*([\d.]+)} $log2 res1 cpu2] } { set stat(cpu1) [expr $stat(cpu1) + $cpu1] set stat(cpu2) [expr $stat(cpu2) + $cpu2] set gcpu1 [expr $gcpu1 + $cpu1] set gcpu2 [expr $gcpu2 + $cpu2] # compare CPU times with 10% precision (but not less 0.5 sec) - if { [expr abs ($cpu1 - $cpu2) > 0.5 + 0.05 * abs ($cpu1 + $cpu2)] } { - _log_and_puts log "CPU [split $basename /] $casename: [_diff_show_ratio $cpu1 $cpu2]" + if { [expr abs ($cpu1 - $cpu2) > 0.5 + 0.05 * abs ($cpu1 + $cpu2)] } { + _log_and_puts log "CPU [split $basename /] $casename: [_diff_show_ratio $cpu1 $cpu2]" } - } + } # check memory delta set mem1 UNDEFINED set mem2 UNDEFINED - if { [regexp {MEMORY DELTA:\s*([\d.]+)} $log1 res1 mem1] && - [regexp {MEMORY DELTA:\s*([\d.]+)} $log2 res1 mem2] } { + if { [regexp {MEMORY DELTA:\s*([\d.]+)} $log1 res1 mem1] && + [regexp {MEMORY DELTA:\s*([\d.]+)} $log2 res1 mem2] } { set stat(mem1) [expr $stat(mem1) + $mem1] set stat(mem2) [expr $stat(mem2) + $mem2] set gmem1 [expr $gmem1 + $mem1] set gmem2 [expr $gmem2 + $mem2] # compare memory usage with 10% precision (but not less 16 KiB) - if { [expr abs ($mem1 - $mem2) > 16 + 0.05 * abs ($mem1 + $mem2)] } { - _log_and_puts log "MEMORY [split $basename /] $casename: [_diff_show_ratio $mem1 $mem2]" + if { [expr abs ($mem1 - $mem2) > 16 + 0.05 * abs ($mem1 + $mem2)] } { + _log_and_puts log "MEMORY [split $basename /] $casename: [_diff_show_ratio $mem1 $mem2]" } - } + } # check images set imglist1 [glob -directory $path1 -types f -tails -nocomplain ${casename}.{png,gif} ${casename}-*.{png,gif} ${casename}_*.{png,gif}] @@ -1862,7 +1886,7 @@ proc _test_diff {dir1 dir2 basename status verbose _logvar {_statvar ""}} { if { [llength $imgin2] > 0 } { _log_and_puts log "Only in $path2: $imgin2" } } foreach imgfile $imgcommon { -# if { $verbose > 1 } { _log_and_puts log "Checking [split basename /] $casename: $imgfile" } + # if { $verbose > 1 } { _log_and_puts log "Checking [split basename /] $casename: $imgfile" } set diffile [_diff_img_name $dir1 $dir2 $basename $imgfile] if { [catch {diffimage [file join $dir1 $basename $imgfile] \ [file join $dir2 $basename $imgfile] \ @@ -1875,14 +1899,14 @@ proc _test_diff {dir1 dir2 basename status verbose _logvar {_statvar ""}} { file delete -force $diffile ;# clean useless artifact of diffimage } } - } + } # report CPU and memory difference in group if it is greater than 10% if { [expr abs ($gcpu1 - $gcpu2) > 0.5 + 0.005 * abs ($gcpu1 + $gcpu2)] } { _log_and_puts log "CPU [split $basename /]: [_diff_show_ratio $gcpu1 $gcpu2]" } - if { [expr abs ($gmem1 - $gmem2) > 16 + 0.005 * abs ($gmem1 + $gmem2)] } { - _log_and_puts log "MEMORY [split $basename /]: [_diff_show_ratio $gmem1 $gmem2]" + if { [expr abs ($gmem1 - $gmem2) > 16 + 0.005 * abs ($gmem1 + $gmem2)] } { + _log_and_puts log "MEMORY [split $basename /]: [_diff_show_ratio $gmem1 $gmem2]" } } @@ -1899,7 +1923,7 @@ proc _log_html_diff {file log dir1 dir2 highlight_percent} { # try to open a file if [catch {set fd [open $file w]} res] { - error "Error saving log file $file: $res" + error "Error saving log file $file: $res" } # print header @@ -1924,8 +1948,8 @@ proc _log_html_diff {file log dir1 dir2 highlight_percent} { # add images if { [regexp {IMAGE[ \t]+([^:]+):[ \t]+([A-Za-z0-9_.-]+)} $line res case img] } { if { [catch {eval file join "" [lrange $case 0 end-1]} gridpath] } { - # note: special handler for the case if test grid directoried are compared directly - set gridpath "" + # note: special handler for the case if test grid directoried are compared directly + set gridpath "" } set img1 "" set img2 "" @@ -1963,11 +1987,11 @@ proc _get_nb_cpus {} { return 0 ;# should never happen, but... } set nb 0 - while { [gets $fd line] >= 0 } { - if { [regexp {^processor[ \t]*:} $line] } { - incr nb - } - } + while { [gets $fd line] >= 0 } { + if { [regexp {^processor[ \t]*:} $line] } { + incr nb + } + } close $fd return $nb } elseif { "$tcl_platform(os)" == "Darwin" } { @@ -2072,12 +2096,12 @@ proc _check_file_format {file} { # procedure to load file knowing its format proc load_data_file {file format shape} { switch $format { - BREP { uplevel restore $file $shape } - DRAW { uplevel restore $file $shape } - IGES { pload XSDRAW; uplevel igesbrep $file $shape * } - STEP { pload XSDRAW; uplevel stepread $file __a *; uplevel renamevar __a_1 $shape } - STL { pload XSDRAW; uplevel readstl $shape $file } - default { error "Cannot read $format file $file" } + BREP { uplevel restore $file $shape } + DRAW { uplevel restore $file $shape } + IGES { pload XSDRAW; uplevel igesbrep $file $shape * } + STEP { pload XSDRAW; uplevel stepread $file __a *; uplevel renamevar __a_1 $shape } + STL { pload XSDRAW; uplevel readstl $shape $file } + default { error "Cannot read $format file $file" } } } @@ -2149,8 +2173,8 @@ proc _testgrid_process_jobs {worker {nb_ok 0}} { # update summary log with requested period if { $logdir != "" && $refresh > 0 && [clock seconds] > $refresh_timer + $refresh } { - _log_summarize $logdir $log - set refresh_timer [clock seconds] + _log_summarize $logdir $log + set refresh_timer [clock seconds] } } catch {tpool::suspend $worker} @@ -2172,14 +2196,14 @@ proc checkcolor { coord_x coord_y rd_get gr_get bl_get } { puts "BLUE color of RGB is $bl_get" if { $coord_x <= 1 || $coord_y <= 1 } { - puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y" - return -1 + puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y" + return -1 } set color "" catch { [set color "[vreadpixel ${coord_x} ${coord_y} rgb]"] } if {"$color" == ""} { - puts "Error : Pixel coordinates (${position_x}; ${position_y}) are out of view" + puts "Error : Pixel coordinates (${position_x}; ${position_y}) are out of view" } set rd [lindex $color 0] set gr [lindex $color 1] @@ -2192,52 +2216,52 @@ proc checkcolor { coord_x coord_y rd_get gr_get bl_get } { set bl_ch [expr int($bl_get * 1.e+05)] if { $rd_ch != 0 } { - set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch] + set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch] } else { - set tol_rd $rd_int + set tol_rd $rd_int } if { $gr_ch != 0 } { - set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch] + set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch] } else { - set tol_gr $gr_int + set tol_gr $gr_int } if { $bl_ch != 0 } { - set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch] + set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch] } else { - set tol_bl $bl_int + set tol_bl $bl_int } set status 0 if { $tol_rd > 0.2 } { - puts "Warning : RED light of additive color model RGB is invalid" - set status 1 + puts "Warning : RED light of additive color model RGB is invalid" + set status 1 } if { $tol_gr > 0.2 } { - puts "Warning : GREEN light of additive color model RGB is invalid" - set status 1 + puts "Warning : GREEN light of additive color model RGB is invalid" + set status 1 } if { $tol_bl > 0.2 } { - puts "Warning : BLUE light of additive color model RGB is invalid" - set status 1 + puts "Warning : BLUE light of additive color model RGB is invalid" + set status 1 } if { $status != 0 } { - puts "Warning : Colors of default coordinate are not equal" + puts "Warning : Colors of default coordinate are not equal" } global stat if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } { - set info [_checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch] - set stat [lindex $info end] - if { ${stat} != 1 } { - puts "Error : Colors are not equal in default coordinate and in the near coordinates too" - return $stat - } else { - puts "Point with valid color was found" - return $stat - } + set info [_checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch] + set stat [lindex $info end] + if { ${stat} != 1 } { + puts "Error : Colors are not equal in default coordinate and in the near coordinates too" + return $stat + } else { + puts "Point with valid color was found" + return $stat + } } else { - set stat 1 + set stat 1 } } @@ -2248,52 +2272,52 @@ proc _checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} { set mistake 0 set i 0 while { $mistake != 1 && $i <= 5 } { - set j 0 - while { $mistake != 1 && $j <= 5 } { - set position_x [expr ${x_start} + $j] - set position_y [expr ${y_start} + $i] - puts $position_x - puts $position_y + set j 0 + while { $mistake != 1 && $j <= 5 } { + set position_x [expr ${x_start} + $j] + set position_y [expr ${y_start} + $i] + puts $position_x + puts $position_y - set color "" - catch { [set color "[vreadpixel ${position_x} ${position_y} rgb]"] } - if {"$color" == ""} { - puts "Warning : Pixel coordinates (${position_x}; ${position_y}) are out of view" + set color "" + catch { [set color "[vreadpixel ${position_x} ${position_y} rgb]"] } + if {"$color" == ""} { + puts "Warning : Pixel coordinates (${position_x}; ${position_y}) are out of view" + incr j + continue + } + set rd [lindex $color 0] + set gr [lindex $color 1] + set bl [lindex $color 2] + set rd_int [expr int($rd * 1.e+05)] + set gr_int [expr int($gr * 1.e+05)] + set bl_int [expr int($bl * 1.e+05)] + + if { $rd_ch != 0 } { + set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch] + } else { + set tol_rd $rd_int + } + if { $gr_ch != 0 } { + set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch] + } else { + set tol_gr $gr_int + } + if { $bl_ch != 0 } { + set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch] + } else { + set tol_bl $bl_int + } + + if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } { + puts "Warning : Point with true color was not found near default coordinates" + set mistake 0 + } else { + set mistake 1 + } incr j - continue - } - set rd [lindex $color 0] - set gr [lindex $color 1] - set bl [lindex $color 2] - set rd_int [expr int($rd * 1.e+05)] - set gr_int [expr int($gr * 1.e+05)] - set bl_int [expr int($bl * 1.e+05)] - - if { $rd_ch != 0 } { - set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch] - } else { - set tol_rd $rd_int - } - if { $gr_ch != 0 } { - set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch] - } else { - set tol_gr $gr_int - } - if { $bl_ch != 0 } { - set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch] - } else { - set tol_bl $bl_int - } - - if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } { - puts "Warning : Point with true color was not found near default coordinates" - set mistake 0 - } else { - set mistake 1 - } - incr j - } - incr i + } + incr i } return $mistake } diff --git a/src/GeometryTest/GeometryTest_TestProjCommands.cxx b/src/GeometryTest/GeometryTest_TestProjCommands.cxx index 5ec57e08a2..1a075b58f3 100644 --- a/src/GeometryTest/GeometryTest_TestProjCommands.cxx +++ b/src/GeometryTest/GeometryTest_TestProjCommands.cxx @@ -297,10 +297,13 @@ static Standard_Integer xdistcc2ds(Draw_Interpretor& , Standard_Integer n, const //function : xdistcs //purpose : //======================================================================= -static Standard_Integer xdistcs(Draw_Interpretor& , Standard_Integer n, const char** a) +static Standard_Integer xdistcs(Draw_Interpretor& di, Standard_Integer n, const char** a) { - if (n<5) { - cout<<" Use xdistcs c s t1 t2 nbp"<5) { aNbP=Draw::Atoi(a[5]); } + Standard_Real anErrTol = (n > 6 ? Draw::Atof(a[6]) : RealLast()); + Standard_Real aWarnTol = (n > 7 ? Draw::Atof(a[7]) : RealLast()); // iSize=3; // @@ -349,12 +354,23 @@ static Standard_Integer xdistcs(Draw_Interpretor& , Standard_Integer n, const ch aPPS.Init(aP, aS, aTol); bRet=aPPS.IsDone(); if (!bRet) { - cout<<" GeomAPI_ProjectPointOnSurf failed"< anErrTol) + { + di << "Error :"; + } + else if (aD > aWarnTol) + { + di << "Attention (critical value of tolerance) :"; + } + char aMsg[256]; + sprintf(aMsg," T=%lg\tD=%lg\n", aT, aD); + di << aMsg; // aMr=new Draw_Marker3D(aP, Draw_Plus, aColor, iSize); dout << aMr; @@ -381,7 +397,7 @@ void GeometryTest::TestProjCommands(Draw_Interpretor& theCommands) g = "Testing of projection (geometric objects)"; - theCommands.Add("xdistcs", "xdistcs c s t1 t2 nbp", __FILE__, xdistcs, g); + theCommands.Add("xdistcs", "xdistcs curve surface t1 t2 nbpoints [tol [warn_tol]]", __FILE__, xdistcs, g); theCommands.Add("xdistcc2ds", "xdistcc2ds c c2d s t1 t2 nbp", __FILE__, xdistcc2ds, g); theCommands.Add("xdistc2dc2dss", "xdistc2dc2dss c2d_1 c2d_2 s1 s2 t1 t2 nbp", __FILE__, xdistc2dc2dss, g); theCommands.Add("xdistcc", "xdistcc c1 c2 t1 t2 nbp", __FILE__, xdistcc, g); diff --git a/tests/bugs/begin b/tests/bugs/begin index 8a7088ee72..24cdf412b1 100755 --- a/tests/bugs/begin +++ b/tests/bugs/begin @@ -107,32 +107,6 @@ proc CheckTriArea {shape {eps 0}} { expr ($t_area - $g_area) / $g_area * 100 } -# Check if list of xdistcs-command is valid -proc checkList {List Tolerance D_good Limit_Tol} { - set L1 [llength ${List}] - set L2 10 - set L3 5 - set N [expr (${L1} - ${L2})/${L3} + 1] - - for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List} ${j1}] - set D [lindex ${List} ${j2}] - #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error : T=${T} D=${D}" - } - - if { ${Tolerance} > ${Limit_Tol} } { - if { [expr abs(${D} - ${D_good})] > ${Limit_Tol} - && [expr abs(${D} - ${D_good})] <= ${Tolerance} } { - puts "Attention (critical value of tolerance) : T=${T} D=${D}" - } - } - } -} - # Check expected time proc checktime {value expected tol_rel message} { set t1 [expr ${value} - ${expected}] diff --git a/tests/bugs/caf/bug1138 b/tests/bugs/caf/bug1138 index 2fa8b988c2..fa28f79dd8 100755 --- a/tests/bugs/caf/bug1138 +++ b/tests/bugs/caf/bug1138 @@ -1,33 +1,23 @@ puts "TODO ?OCC12345 Linux: An exception was caught" puts "TODO ?OCC12345 Linux: Faulty OCC1138 : here is reading problem when the filename is a directory name." puts "TODO ?OCC12345 Linux: Faulty OCC1138" +puts "TODO ?OCC12345 Linux: \\*\\* Exception \\*\\*" puts "================" puts "OCC1138" puts "================" puts "" -####################################################################################### +############################################################ # OSD_SIGSEGV is thrown during call LDOMParser.parse method -####################################################################################### +############################################################ pload QAcommands set BugNumber OCC1138 -set status 0 -decho off -if [catch { OCC983 ${imagedir} } result] { -decho on +if [catch { OCC983 ${imagedir} }] { puts "Faulty ${BugNumber} : here is reading problem when the filename is a directory name." - set status 1 } else { puts "Reading ${BugNumber} OK : here is not reading problem when the filename is a directory name." } -# Resume -puts "" -if { ${status} != 0 } { - puts "Faulty ${BugNumber}" -} else { - puts "OK ${BugNumber}" -} diff --git a/tests/bugs/demo/bug25020 b/tests/bugs/demo/bug25020 index e1f51c47d5..2051e1af42 100755 --- a/tests/bugs/demo/bug25020 +++ b/tests/bugs/demo/bug25020 @@ -9,10 +9,7 @@ puts "" restore [locate_data_file bug25020_b.brep] b explode b e -dlog reset -dlog on -catch {checkoverlapedges b_1 b_2} -set info [dlog get] +catch {checkoverlapedges b_1 b_2} info if { [regexp "degenerated" ${info} ] == 1 } { puts "OK : checkoverlapedges have the check for degenerated edges" diff --git a/tests/bugs/heal/bug23944 b/tests/bugs/heal/bug23944 index 565bff257e..18ae738fb4 100755 --- a/tests/bugs/heal/bug23944 +++ b/tests/bugs/heal/bug23944 @@ -2,25 +2,18 @@ puts "============" puts "OCC23944" puts "============" puts "" -################################################### +#################################################################################### ## Typo in ShapeCustom_RestrictionParameters leading to wrong approximation results -################################################### - -set BugNumber OCC23944 +#################################################################################### restore [locate_data_file bug23944_s.draw] s -decho off mkface f s bsplres result f 1e-4 1e-9 15 100 C1 C2 0 1 mksurface rsurf result -set info [getsurfcontinuity rsurf] -decho on -# Resume -puts "" -if { [regexp {rsurf has C0 continuity.} $info] } { - puts "OK ${BugNumber}" -} else { - puts "Faulty ${BugNumber}" +set info [getsurfcontinuity rsurf] + +if { ![regexp {rsurf has C0 continuity.} $info] } { + puts "Faulty OCC23944" } diff --git a/tests/bugs/heal/bug24218 b/tests/bugs/heal/bug24218 index 32bab7bcc7..46dfde2de6 100644 --- a/tests/bugs/heal/bug24218 +++ b/tests/bugs/heal/bug24218 @@ -2,16 +2,12 @@ puts "============" puts "OCC24218" puts "============" puts "" -####################################################################### +##################################################################################################### ## ShapeFix_Face requires double execution to produce valid shape when FixSplitFaceMode is in effect -####################################################################### +##################################################################################################### restore [locate_data_file bug24218_f.brep] f -decho off -checkshape f -decho on - fixshape r f +o checkshape r diff --git a/tests/bugs/heal/bug25923 b/tests/bugs/heal/bug25923 index 76f0ba1ed1..5041693086 100644 --- a/tests/bugs/heal/bug25923 +++ b/tests/bugs/heal/bug25923 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "========" puts "OCC25923" puts "========" @@ -10,39 +11,17 @@ smallview restore [locate_data_file OCC25923_FixSmallWire_Orientation.brep] a fit -dlog reset -dlog on -decho off checkshape a -set bug_info_1 [dlog get] -set bug_info_1 [lrange $bug_info_1 2 7] -decho on -fixshape r a +s +o 1e-3 -dlog reset -dlog on -decho off -checkshape r -set bug_info_2 [dlog get] -set bug_info_2 [lrange $bug_info_2 2 7] -decho on +fixshape r1 a +s +o 1e-3 -fixshape r r +o -dlog reset -dlog on -decho off -checkshape r -set bug_info_3 [dlog get] -set bug_info_3 [lrange $bug_info_3 2 7] -decho on +fixshape r2 r1 +o -if {[string compare $bug_info_1 "This shape seems to be valid"] != 0} { - puts "ERRROR: Restored shape is not valid." -} -if {[string compare $bug_info_2 "This shape seems to be valid"] == 0} { +if {[regexp {This shape seems to be valid} [checkshape r1] ]} { puts "ERRROR: OCC25923 is reproduced. Algorythm of removing small wires on face does not work." } -if {[string compare $bug_info_3 "This shape seems to be valid"] != 0} { + +if {![regexp {This shape seems to be valid} [checkshape r2] ]} { puts "ERRROR: OCC25923 is reproduced. Algorythm of removing small wires on face does not work." } diff --git a/tests/bugs/mesh/bug25307 b/tests/bugs/mesh/bug25307 index 9a4abed59b..51f12f44fb 100644 --- a/tests/bugs/mesh/bug25307 +++ b/tests/bugs/mesh/bug25307 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Not connected mesh inside face" puts "==========" puts "OCC25307" puts "==========" @@ -12,19 +13,18 @@ vinit vsetdispmode 1 vdisplay res vfit -decho off + set info1 [tricheck res] -decho on -regexp "Free_links +(\[0-9\]+) +Cross_face_errors +(\[0-9\]+) +Async_edges +(\[0-9\]+) +Free_nodes +(\[0-9\]+)" $info1 full freelinks1 crossfaces1 asyncedges1 freenodes1 +set pattern "Free_links +(\[0-9\]+) +Cross_face_errors +(\[0-9\]+) +Async_edges +(\[0-9\]+) +Free_nodes +(\[0-9\]+)" +regexp "${pattern}" $info1 full freelinks1 crossfaces1 asyncedges1 freenodes1 vclear vdisplay res vsetdispmode 1 vfit -decho off + set info2 [tricheck res] -decho on -regexp "Free_links +(\[0-9\]+) +Cross_face_errors +(\[0-9\]+) +Async_edges +(\[0-9\]+) +Free_nodes +(\[0-9\]+)" $info2 full freelinks2 crossfaces2 asyncedges2 freenodes2 +regexp "${pattern}" $info2 full freelinks2 crossfaces2 asyncedges2 freenodes2 if { $freelinks1 != $freelinks2 } { puts "Error: Free links are not equal" } else { diff --git a/tests/bugs/mesh/bug25469_3 b/tests/bugs/mesh/bug25469_3 index b8c5e66de3..dbfb922c44 100755 --- a/tests/bugs/mesh/bug25469_3 +++ b/tests/bugs/mesh/bug25469_3 @@ -27,10 +27,7 @@ vtop vfit vmoveto 200 150 -dlog reset -dlog off checkcolor 64 200 1 0.72549021244049072 0.12941177189350128 -dlog on if { ${stat} == 1} { puts "Error : Bad triangulation" diff --git a/tests/bugs/modalg_2/bug22864 b/tests/bugs/modalg_2/bug22864 index c90ce3bf95..82375fb2fe 100755 --- a/tests/bugs/modalg_2/bug22864 +++ b/tests/bugs/modalg_2/bug22864 @@ -44,16 +44,16 @@ for {set i 0} {$i < ${Numbers}} {incr i} { close ${fp} # if {$i == 0} { - set StandardLog ${Log} + set Standard_Log ${Log} } else { - set info_result [string compare ${Log} ${StandardLog}] + set info_result [string compare ${Log} ${Standard_Log}] if {${info_result} == 0} { - # Log == StandardLog - puts "Log == StandardLog" + # Log == Standard_Log + puts "Log == Standard_Log" } else { - # Log != StandardLog + # Log != Standard_Log set status 1 - puts "Log != StandardLog" + puts "Log != Standard_Log" } } } diff --git a/tests/bugs/modalg_2/bug23 b/tests/bugs/modalg_2/bug23 index be9031fb08..ebfd9eb35b 100755 --- a/tests/bugs/modalg_2/bug23 +++ b/tests/bugs/modalg_2/bug23 @@ -1,24 +1,16 @@ -puts "TODO OCC12345 ALL: Faulty OCC23 : Checkshape command works wrongly" +puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty" puts "TODO OCC12345 ALL: Error : The length of result shape is" puts "================" puts "OCC23" puts "================" puts "" -##################################################################### +########################################################################################################## ## Checkshape gives result that there is a selfintersection on wire, but there are no intersection on it. -##################################################################### +########################################################################################################## restore [locate_data_file OCC23.brep] sh -decho off -set che [checkshape sh] -decho on - -if { [regexp {Faulty} $che] == 1 } { - puts "Faulty OCC23 : Checkshape command works wrongly" -} else { - puts "OCC23 OK : Checkshape command works properly" -} +checkshape sh explode sh f explode sh_2 w diff --git a/tests/bugs/modalg_2/bug23530 b/tests/bugs/modalg_2/bug23530 index ae2158e407..6a9fae8e86 100755 --- a/tests/bugs/modalg_2/bug23530 +++ b/tests/bugs/modalg_2/bug23530 @@ -1,17 +1,16 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "========" puts "CR23530" puts "========" puts "" -################################################## +###################################################################### ## Error in Draw command "checkshape": invalid face is not recognized -################################################## +###################################################################### restore [locate_data_file bug23530_BadFace.brep] result pcurve result -decho off set CheckLog [checkshape result] -decho on if { [regexp "BRepCheck_UnorientableShape" ${CheckLog}] != 1 } { puts "CR23530: Error" diff --git a/tests/bugs/modalg_2/bug305 b/tests/bugs/modalg_2/bug305 index 507957a3fe..598bd94cba 100755 --- a/tests/bugs/modalg_2/bug305 +++ b/tests/bugs/modalg_2/bug305 @@ -7,61 +7,9 @@ puts "========" puts "OCC305" puts "========" puts "" -###################################################### +########################################################### # BRepOffsetAPI_MakeOffset: problem with offsetting a wire -###################################################### - -puts "" -puts "Bug's attributes" -puts "################" -puts "" -puts "Customer : Telco" -puts "Channel : External" -puts "Version : 4.0" -puts "OS : IRIX" -puts "Urgency : High" -puts "Type : BUG" -puts "" -puts "Summary: BRepOffsetAPI_MakeOffset: problem with offsetting a wire" -puts "" -puts "Description:" -puts "I am attaching the brep file of a curve, obtained from intersection with a" -puts "plane. Its a planer curve and we want to offset it by the amount which" -puts "is feasible. after trying with all options we were not able to offset it." -puts "But the same wire when we read inside EUCLID3 as well as CATIA it does" -puts "the offset correctly." -puts "" -puts "" -puts "Bug's advancement" -puts "#################" -puts "" -puts "Customer version Development version" -puts "Status : CLOSED Status : CLOSED" -puts "Resolution : NOT Resolution : NOT" -puts "Leave as CLOSED NOT Leave as CLOSED NOT" -puts "" -puts "" -puts "Bug's history" -puts "#############" -puts "" -puts "------- Additional Comments From Igor NAZAROV-BUGMASTER 2002-04-19 16:21 -------" -puts "Dear Sergey," - -puts "Below you will find conclusion of JGV about thia bug" -puts "Bugmaster" -puts " This case can not be done by existing algorithm. It is mathematical" -puts "limitation: the offset may be performed only from at least C1-continuous" -puts "curve, but all the 12 edges of initial wire are based on C0-continuous" -puts "curves." -puts " I may modify the algorithm so that it splits initial edges into" -puts "C1-continuous curves, but then resulting wire will consist of too many" -puts "small edges (in our case the number of edges will increase about 100" -puts "times)." -puts " But user may obtain initial wire more smooth: when he intersects" -puts "something with a plane by command \"section\", he can add the key \"-a\"" -puts "(force approximation)." -puts "" -puts "" +########################################################### catch {pload XDE} @@ -69,16 +17,9 @@ restore [locate_data_file OCC305.brep] a checkshape a if [catch {mkoffset result a 1 0.5 } catch_result] { - puts "Faulty OCC305 : function MKOFFSET works wrongly" + puts "Faulty OCC305 : function MKOFFSET works wrongly" } else { - decho off - set che [checkshape result] - decho on - if { [regexp {This shape seems to be valid} $che] == 1} { - puts "OCC305 OK" - } else { - puts "Faulty OCC305" - } + set che [checkshape result] } set square 0 set 2dviewer 0 diff --git a/tests/bugs/modalg_2/bug323 b/tests/bugs/modalg_2/bug323 index a2b10acc70..bc287c47f6 100755 --- a/tests/bugs/modalg_2/bug323 +++ b/tests/bugs/modalg_2/bug323 @@ -1,4 +1,3 @@ - puts "================" puts "OCC323" puts "OCC229" @@ -8,44 +7,12 @@ puts "" restore [locate_data_file OCC323.brep] f explode f -decho off -set che [checkshape f_1] -decho on - -if { [regexp {Faulty} $che ] == 1 } { - puts "Warning OCC323 (shape1): Source shape is NOT correct. It was detected by Checkshape command" -} else { - puts "OCC323 OK (shape1): Source shape is valid" -} - -decho off -set che [checkshape f_2] -decho on - -if { [regexp {Faulty} $che ] == 1 } { - puts "Warning OCC323 (shape2): Source shape is NOT correct. It was detected by Checkshape command" -} else { - puts "OCC323 OK (shape2): Source shape is valid" -} - bsection r f_1 f_2 + checkshape r -puts [checksection r] - -decho off -set che [checkshape f_3] -decho on - -if { [regexp {Faulty} $che ] == 1 } { - puts "Warning OCC323 (shape3): Source shape is invalid. It was detected by Checkshape command" -} else { - puts "OCC323 OK (shape3): Source shape is valid" -} +checksection r bsection result f_1 f_3 set length 1 set 2dviewer 0 - - - diff --git a/tests/bugs/modalg_2/bug330 b/tests/bugs/modalg_2/bug330 index bdf17c6aff..5c379ae18a 100755 --- a/tests/bugs/modalg_2/bug330 +++ b/tests/bugs/modalg_2/bug330 @@ -1,3 +1,4 @@ +# TODOs statements should be replaced by REQUIRED after bug fixing. puts "TODO OCC12345 ALL: Faulty OCC330: Checkshape command works wrongly" puts "TODO OCC12345 ALL: Error : The square of result shape is" @@ -11,9 +12,7 @@ puts "" restore [locate_data_file OCC330.brep] result -decho off set che [checkshape result] -decho on if { [regexp {Faulty} $che ] != 1 } { puts "Faulty OCC330: Checkshape command works wrongly" diff --git a/tests/bugs/modalg_2/bug548 b/tests/bugs/modalg_2/bug548 index b301f73ed9..9891d4e5ac 100755 --- a/tests/bugs/modalg_2/bug548 +++ b/tests/bugs/modalg_2/bug548 @@ -3,22 +3,15 @@ puts "OCC548" puts "OCC628" puts "========" puts "" -################################################################## +#################################################################################### # Function BRepTool::IsClosed returns Standard_True although argument is open shell # Incorrect work of BRepCheck -################################################################## +#################################################################################### pload XDE restore [locate_data_file CTO908_topo103-t.brep] a -decho off - -checkshape a -checkshape a b - -decho on - fixshape result a 0.001 set che [checkshape result c] diff --git a/tests/bugs/modalg_2/bug5729 b/tests/bugs/modalg_2/bug5729 index e3f4a80247..ae84e4b341 100755 --- a/tests/bugs/modalg_2/bug5729 +++ b/tests/bugs/modalg_2/bug5729 @@ -11,19 +11,8 @@ set BugNumber OCC5729 restore [locate_data_file OCC5729-f1.brep] f1 restore [locate_data_file OCC5729-f2.brep] f2 -decho off -set che_1 [checkshape f1] -decho on -if { [regexp {Faulty} $che_1] } { - puts "Faulty ${BugNumber} : checkshape is wrong for f1" -} - -decho off -set che_2 [checkshape f2] -decho on -if { [regexp {Faulty} $che_2] } { - puts "Faulty ${BugNumber} : checkshape is wrong for f2" -} +checkshape f1 +checkshape f2 bfuse result f1 f2 diff --git a/tests/bugs/modalg_2/bug5805_3 b/tests/bugs/modalg_2/bug5805_3 index 034795edfb..60909a6cd8 100755 --- a/tests/bugs/modalg_2/bug5805_3 +++ b/tests/bugs/modalg_2/bug5805_3 @@ -12,12 +12,7 @@ set BugNumber OCC5805 restore [locate_data_file OCC5805.brep] a -decho off -set che_a [checkshape a] -decho on -if { [regexp {Faulty} $che_a] } { - puts "Faulty ${BugNumber} : checkshape is wrong for a" -} +checkshape a explode a f diff --git a/tests/bugs/modalg_2/bug5805_4 b/tests/bugs/modalg_2/bug5805_4 index 75131580f4..2c86dd0e5d 100755 --- a/tests/bugs/modalg_2/bug5805_4 +++ b/tests/bugs/modalg_2/bug5805_4 @@ -14,13 +14,7 @@ set BugNumber OCC5805 restore [locate_data_file OCC5805.brep] a -decho off -set che_a [checkshape a] -decho on - -if { [regexp {Faulty} $che_a] } { - puts "Faulty ${BugNumber} : checkshape is wrong for a" -} +checkshape a explode a f diff --git a/tests/bugs/modalg_2/bug5805_5 b/tests/bugs/modalg_2/bug5805_5 index cd5be904fe..8baf64d256 100755 --- a/tests/bugs/modalg_2/bug5805_5 +++ b/tests/bugs/modalg_2/bug5805_5 @@ -10,12 +10,7 @@ set BugNumber OCC5805 restore [locate_data_file OCC5805.brep] a -decho off -set che_a [checkshape a] -decho on -if { [regexp {Faulty} $che_a] } { - puts "Faulty ${BugNumber} : checkshape is wrong for a" -} +checkshape a explode a f diff --git a/tests/bugs/modalg_3/bug5805_6 b/tests/bugs/modalg_3/bug5805_6 index 53aca28b5c..4e642fce67 100755 --- a/tests/bugs/modalg_3/bug5805_6 +++ b/tests/bugs/modalg_3/bug5805_6 @@ -10,12 +10,7 @@ set BugNumber OCC5805 restore [locate_data_file OCC5805.brep] a -decho off -set che_a [checkshape a] -decho on -if { [regexp {Faulty} $che_a] } { - puts "Faulty ${BugNumber} : checkshape is wrong for a" -} +checkshape a if { [catch { offsetshape result a -1 } catch_result] } { puts "Faulty ${BugNumber} : offsetshape is wrong" diff --git a/tests/bugs/modalg_3/bug6063 b/tests/bugs/modalg_3/bug6063 index d397d8c667..84364cbcb1 100755 --- a/tests/bugs/modalg_3/bug6063 +++ b/tests/bugs/modalg_3/bug6063 @@ -11,12 +11,7 @@ cpulimit 2000 restore [locate_data_file OCC6063-2.brep] result -decho off -set che_res [checkshape result] -decho on -if { [regexp {Faulty} $che_res] } { - puts "Faulty ${BugNumber} : checkshape is wrong for res" -} +checkshape result set tol_square 1.e-6 set square 2465.96 diff --git a/tests/bugs/modalg_4/bug6181 b/tests/bugs/modalg_4/bug6181 index 7fcda4790c..ff529aa117 100755 --- a/tests/bugs/modalg_4/bug6181 +++ b/tests/bugs/modalg_4/bug6181 @@ -11,17 +11,8 @@ set BugNumber OCC6181 restore [locate_data_file OCC6181_A.brep] s1 restore [locate_data_file OCC6181_B.brep] s2 -decho off -set che_s1 [checkshape s1] -set che_s2 [checkshape s2] -decho on -if { [regexp {Faulty} $che_s1] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s1" -} - -if { [regexp {Faulty} $che_s2] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s2" -} +checkshape s1 +checkshape s2 bcut result s1 s2 diff --git a/tests/bugs/modalg_4/bug6182 b/tests/bugs/modalg_4/bug6182 index 9087810fe3..06e6266b6b 100755 --- a/tests/bugs/modalg_4/bug6182 +++ b/tests/bugs/modalg_4/bug6182 @@ -11,17 +11,9 @@ set BugNumber OCC6182 restore [locate_data_file OCC6182_A.brep] s1 restore [locate_data_file OCC6182_B.brep] s2 -decho off -set che_s1 [checkshape s1] -set che_s2 [checkshape s2] -decho on -if { [regexp {Faulty} $che_s1] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s1" -} -if { [regexp {Faulty} $che_s2] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s2" -} - +checkshape s1 +checkshape s2 + bcut result s1 s2 set square 318709 diff --git a/tests/bugs/modalg_4/bug6277 b/tests/bugs/modalg_4/bug6277 index f28c995ba3..9cba2a8d68 100755 --- a/tests/bugs/modalg_4/bug6277 +++ b/tests/bugs/modalg_4/bug6277 @@ -13,18 +13,9 @@ set BugNumber OCC6277 restore [locate_data_file OCC6277_A.brep] s1 restore [locate_data_file OCC6277_B.brep] s2 -decho off -set che_s1 [checkshape s1] -set che_s2 [checkshape s2] -decho on -if { [regexp {Faulty} $che_s1] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s1" -} - -if { [regexp {Faulty} $che_s2] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s2" -} - +checkshape s1 +checkshape s2 + bcut result s1 s2 set square 40084.9 diff --git a/tests/bugs/modalg_4/bug6334 b/tests/bugs/modalg_4/bug6334 index 5f935e0ecb..07dc858d90 100755 --- a/tests/bugs/modalg_4/bug6334 +++ b/tests/bugs/modalg_4/bug6334 @@ -2,9 +2,9 @@ puts "============" puts "OCC6334" puts "============" puts "" -###################################################### +##################################################################### # Invalid result of MakeCylindricalHole when input solid is REVERSED -###################################################### +##################################################################### set BugNumber OCC6334 @@ -14,13 +14,7 @@ box b 100 100 100 subshape b f 1 offsetshape t b 10 b_1 -decho off -set che_t [checkshape t] -decho on - -if {[regexp {Faulty} $che_t]} { - puts "Faulty ${BugNumber} : checkshape is wrong for t" -} +checkshape t set bnd_t [bounding t] set ori [lindex [dtyp t] 2] diff --git a/tests/bugs/modalg_4/bug6538 b/tests/bugs/modalg_4/bug6538 index b8f79b12ea..cac9c2e0d0 100755 --- a/tests/bugs/modalg_4/bug6538 +++ b/tests/bugs/modalg_4/bug6538 @@ -11,18 +11,8 @@ set BugNumber OCC6538 restore [locate_data_file OCC6538-f1.brep] s1 restore [locate_data_file OCC6538-f2.brep] s2 -decho off -set che_s1 [checkshape s1] -set che_s2 [checkshape s2] -decho on -if { [regexp {Faulty} $che_s1] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s1" -} - -if { [regexp {Faulty} $che_s2] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s2" -} - +checkshape s1 +checkshape s2 bop s1 s2 bopcommon result diff --git a/tests/bugs/modalg_4/bug6554 b/tests/bugs/modalg_4/bug6554 index c462c91b71..5318c6e396 100755 --- a/tests/bugs/modalg_4/bug6554 +++ b/tests/bugs/modalg_4/bug6554 @@ -11,17 +11,8 @@ set BugNumber OCC6554 restore [locate_data_file OCC6554-shell.brep] sh restore [locate_data_file OCC6554-face.brep] f -decho off -set che_sh [checkshape sh] -set che_f [checkshape f] -decho on -if { [regexp {Faulty} $che_sh] } { - puts "Faulty ${BugNumber} : checkshape is wrong for sh" -} - -if { [regexp {Faulty} $che_f] } { - puts "Faulty ${BugNumber} : checkshape is wrong for f" -} +checkshape sh +checkshape f bsection result sh f -n2d diff --git a/tests/bugs/modalg_4/bug6766_1 b/tests/bugs/modalg_4/bug6766_1 index 0be92c0ed7..abd22b1d81 100755 --- a/tests/bugs/modalg_4/bug6766_1 +++ b/tests/bugs/modalg_4/bug6766_1 @@ -10,20 +10,13 @@ set BugNumber OCC6766 restore [locate_data_file OCC6766.brep] a -decho off -set che_a [checkshape a] -decho on -if { [regexp {Faulty} $che_a] } { - puts "Faulty ${BugNumber} : checkshape is wrong for s1" -} +checkshape a set Y 4 plane pl 0 ${Y} 0 0 1 0 mkface f pl bsection result a f - - checknbshapes result -vertex 4 -edge 3 -wire 0 -face 0 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 8 set length 138.474 set 2dviewer 0 diff --git a/tests/bugs/modalg_4/bug6766_2 b/tests/bugs/modalg_4/bug6766_2 index ceec139c83..c7e616c787 100755 --- a/tests/bugs/modalg_4/bug6766_2 +++ b/tests/bugs/modalg_4/bug6766_2 @@ -10,13 +10,8 @@ set BugNumber OCC6766 restore [locate_data_file OCC6766.brep] a -decho off -set che_a [checkshape a] -decho on -if { [regexp {Faulty} $che_a] } { - puts "Faulty ${BugNumber} : checkshape is wrong for a" -} - +checkshape a + set Y 4 plane pl 0 ${Y} 0 0 1 0 mkface f pl diff --git a/tests/bugs/modalg_4/bug6766_3 b/tests/bugs/modalg_4/bug6766_3 index dd81044e21..568316e99d 100755 --- a/tests/bugs/modalg_4/bug6766_3 +++ b/tests/bugs/modalg_4/bug6766_3 @@ -10,13 +10,8 @@ set BugNumber OCC6766 restore [locate_data_file OCC6766.brep] a -decho off -set che_a [checkshape a] -decho on -if { [regexp {Faulty} $che_a] } { - puts "Faulty ${BugNumber} : checkshape is wrong for a" -} - +checkshape a + set Y 6 plane pl 0 ${Y} 0 0 1 0 mkface f pl diff --git a/tests/bugs/modalg_4/bug6766_4 b/tests/bugs/modalg_4/bug6766_4 index 0612434e48..285a607875 100755 --- a/tests/bugs/modalg_4/bug6766_4 +++ b/tests/bugs/modalg_4/bug6766_4 @@ -9,12 +9,8 @@ puts "" set BugNumber OCC6766 restore [locate_data_file OCC6766.brep] a -decho off -set che_a [checkshape a] -decho on -if { [regexp {Faulty} $che_a] } { - puts "Faulty ${BugNumber} : checkshape is wrong for a" -} + +checkshape a set Y 6 plane pl 0 ${Y} 0 0 1 0 diff --git a/tests/bugs/modalg_4/bug6811 b/tests/bugs/modalg_4/bug6811 index 0e48cf949d..f4c24fd62c 100755 --- a/tests/bugs/modalg_4/bug6811 +++ b/tests/bugs/modalg_4/bug6811 @@ -15,17 +15,8 @@ set filepath [locate_data_file trj12_b3-tu-203.stp] if { [catch { stepread $filepath a * } catch_result] } { puts "Faulty ${BugNumber} : here is reading problem" } else { - decho off - set che_a_1 [checkshape a_1 f] - set che_a_2 [checkshape a_1 f] - decho on - if { [regexp {Faulty} $che_a_1] } { - puts "Faulty ${BugNumber} : checkshape 1 is wrong for a" - } - if { [regexp {Faulty} $che_a_2] } { - puts "Faulty ${BugNumber} : checkshape 2 is wrong for a" - } - + checkshape a_1 f + checkshape a_1 f renamevar a_1 result } diff --git a/tests/bugs/modalg_5/bug22831 b/tests/bugs/modalg_5/bug22831 index ed76b72127..db54a084ca 100644 --- a/tests/bugs/modalg_5/bug22831 +++ b/tests/bugs/modalg_5/bug22831 @@ -15,10 +15,8 @@ checkshape sh checkshape f prism pr f -0.0023732630088625609, 0.49562550631034025, 0.86853308809584784 -decho off + checkshape pr -## KO; Faulty shapes in variables faulty_1 to faulty_24 -decho on fixshape prf pr 1.e-4 checkshape prf diff --git a/tests/bugs/modalg_5/bug23948_2 b/tests/bugs/modalg_5/bug23948_2 index 4e60dd3051..2cbd6df977 100644 --- a/tests/bugs/modalg_5/bug23948_2 +++ b/tests/bugs/modalg_5/bug23948_2 @@ -14,30 +14,7 @@ bopcurves f1 f2 mksurface s1 f1 mksurface s2 f2 -dlog reset -dlog on -xdistcs c_1 s2 0 1 10 -set Log1 [dlog get] - -set List1 [split ${Log1} {TD= \t\n}] - -set L1 [llength ${List1}] -set L2 10 -set L3 5 -set N [expr (${L1} - ${L2})/${L3} + 1] -set Tolerance 1.0e-3 -set D_good 0. - -for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List1} ${j1}] - set D [lindex ${List1} ${j2}] - #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" - } -} +xdistcs c_1 s2 0 1 10 1e-3 smallview fit diff --git a/tests/bugs/modalg_5/bug24035 b/tests/bugs/modalg_5/bug24035 index ca1681bcc5..8d104a271a 100644 --- a/tests/bugs/modalg_5/bug24035 +++ b/tests/bugs/modalg_5/bug24035 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_2" puts "============" puts "OCC24035" puts "============" @@ -9,23 +10,5 @@ puts "" restore [locate_data_file bug24035_face1] face1 restore [locate_data_file bug24035_face2] face2 -decho off -set info1 [checkshape face1] -set info2 [checkshape face2] -decho on - -set status 0 -if { [regexp "Faulty shapes in variables faulty_1 to faulty_2" $info1] != 1 } { - puts "Error : There is no 2 mistakes by checkshape on face1" - set status 1 -} -if { [regexp "Faulty shapes in variables faulty_1 to faulty_2" $info2] != 1 } { - puts "Error : There is no 2 mistakes by checkshape on face2" - set stauts 1 -} - -if { $status != 0 } { - puts "Error : Intersector is not symmetrical" -} else { - puts "OK : Intersector is symmetrical" -} +checkshape face1 +checkshape face2 diff --git a/tests/bugs/modalg_5/bug24220 b/tests/bugs/modalg_5/bug24220 index 93a18cd10e..e85fead272 100755 --- a/tests/bugs/modalg_5/bug24220 +++ b/tests/bugs/modalg_5/bug24220 @@ -8,9 +8,7 @@ puts "" restore [locate_data_file bug24220_A.brep] result -decho off set info [bopargcheck result] -decho on if { [regexp "Faulties, that can not be treated by BOP, are detected" ${info}] != 1 } { puts "Error : message is not correct" diff --git a/tests/bugs/modalg_5/bug24299 b/tests/bugs/modalg_5/bug24299 index fe6c6666d1..14cbad2a5e 100755 --- a/tests/bugs/modalg_5/bug24299 +++ b/tests/bugs/modalg_5/bug24299 @@ -15,30 +15,7 @@ mksurface s1 b1_1 mksurface s2 b2_1 intersect i s1 s2 -dlog reset -dlog on -xdistcs i_2 s1 0 1 10 -set Log1 [dlog get] - -set List1 [split ${Log1} {TD= \t\n}] - -set L1 [llength ${List1}] -set L2 10 -set L3 5 -set N [expr (${L1} - ${L2})/${L3} + 1] -set Tolerance 1.0e-5 -set D_good 0. - -for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List1} ${j1}] - set D [lindex ${List1} ${j2}] - #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" - } -} +xdistcs i_2 s1 0 1 10 1e-5 smallview fit diff --git a/tests/bugs/modalg_5/bug24472 b/tests/bugs/modalg_5/bug24472 index 567e60af7d..8fe0c50a23 100755 --- a/tests/bugs/modalg_5/bug24472 +++ b/tests/bugs/modalg_5/bug24472 @@ -23,16 +23,7 @@ intersect i s1 s2 #donly i_22; fit -dlog reset -dlog on -xdistcs i_22 s1 0 1 10 -set Log1 [dlog get] - -set List1 [split ${Log1} {TD= \t\n}] -set Tolerance 1.0e-7 -set D_good 0. -set Limit_Tol 1.0e-7 -checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} +xdistcs i_22 s1 0 1 10 1e-7 puts "" puts "Second test" @@ -45,16 +36,7 @@ mkcurve c r_1 #donly r_1; fit -dlog reset -dlog on -xdistcs c s1 0.0714822451660209 1 10 -set Log2 [dlog get] - -set List2 [split ${Log2} {TD= \t\n}] -set Tolerance 1.0e-12 -set D_good 0. -set Limit_Tol 1.0e-7 -checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} +xdistcs c s1 0.0714822451660209 1 10 1e-12 1e-7 puts "" puts "Third test" @@ -63,16 +45,7 @@ intersect i s1 s3 #donly i_4; fit -dlog reset -dlog on -xdistcs i_4 s1 0 1 10 -set Log3 [dlog get] - -set List3 [split ${Log3} {TD= \t\n}] -set Tolerance 1.0e-6 -set D_good 0. -set Limit_Tol 1.0e-7 -checkList ${List3} ${Tolerance} ${D_good} ${Limit_Tol} +xdistcs i_4 s1 0 1 10 1e-6 1e-7 puts "" puts "Fourth test" @@ -85,13 +58,4 @@ mkcurve c r_1 #donly r_1; fit -dlog reset -dlog on -xdistcs c s1 0.0714822451660209 1 10 -set Log4 [dlog get] - -set List4 [split ${Log4} {TD= \t\n}] -set Tolerance 1.0e-12 -set D_good 0. -set Limit_Tol 1.0e-7 -checkList ${List4} ${Tolerance} ${D_good} ${Limit_Tol} +xdistcs c s1 0.0714822451660209 1 10 1e-12 1e-7 diff --git a/tests/bugs/modalg_5/bug24492 b/tests/bugs/modalg_5/bug24492 index 3560e991f4..290f160ea8 100644 --- a/tests/bugs/modalg_5/bug24492 +++ b/tests/bugs/modalg_5/bug24492 @@ -9,14 +9,11 @@ puts "" box x1 10 10 10 vertex x2 3 3 3 compound x1 x2 b1 -decho off + set info [bopargcheck b1 #f] -decho on if { [regexp "Faulties for FIRST shape found : 1" $info] != 1 } { puts "Error : command bopargcheck produces wrong result" } else { puts "OK : command bopargcheck produces correct result" } - - diff --git a/tests/bugs/modalg_5/bug24650 b/tests/bugs/modalg_5/bug24650 index 86cea01978..326f680576 100644 --- a/tests/bugs/modalg_5/bug24650 +++ b/tests/bugs/modalg_5/bug24650 @@ -46,25 +46,8 @@ while { $AllowRepeate != 0 } { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic sb1tu U1 U2 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic sb2 U1 U2 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic sb1tu U1 U2 10 1e-7 + xdistcs res_$ic sb2 U1 U2 10 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug24915 b/tests/bugs/modalg_5/bug24915 index 10b7e66434..3cdee87475 100755 --- a/tests/bugs/modalg_5/bug24915 +++ b/tests/bugs/modalg_5/bug24915 @@ -1,10 +1,10 @@ puts "TODO OCC25929 ALL: Error: Tolerance is too big!" -puts "TODO OCC21564 Linux: Error : T=0.464646 D=0.000326627" -puts "TODO OCC21564 Linux: Error : T=0.464646 D=0.00032747" +puts "TODO OCC21564 Linux: Error : T=0.464646\tD=0.000326627" +puts "TODO OCC21564 Linux: Error : T=0.464646\tD=0.00032747" -puts "TODO OCC21564 Windows: Error : T=0.464646 D=0.000326671" -puts "TODO OCC21564 Windows: Error : T=0.464646 D=0.000327516" +puts "TODO OCC21564 Windows: Error : T=0.464646\tD=0.000326671" +puts "TODO OCC21564 Windows: Error : T=0.464646\tD=0.000327516" puts "=========" puts "CR24915" @@ -33,36 +33,24 @@ checkshape r set MaxTol 5.0e-7 set log [bopcurves b1 b2] -mksurface s1 b1 -mksurface s2 b2 - -regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv +if { ! [regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv] } { + puts "Error: Cannot find tolerance value in output of bopcurve command" +} if {${Toler} > ${MaxTol}} { puts "Error: Tolerance is too big!" } +mksurface s1 b1 +mksurface s2 b2 + +set Tolerance 2.0e-5 +set WarnTol 1.0e-7 + for {set i 1} {$i <= ${NbCurv}} {incr i} { bounds c_$i U1 U2 - dlog reset - dlog on - xdistcs c_$i s1 U1 U2 100 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 2.0e-5 - set Limit_Tol 1.0e-7 - set D_good 0. - catch {checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}} - - dlog reset - dlog on - xdistcs c_$i s2 U1 U2 100 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 2.0e-5 - set Limit_Tol 1.0e-7 - set D_good 0. - catch {checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol}} + xdistcs c_$i s1 U1 U2 100 $Tolerance $WarnTol + xdistcs c_$i s2 U1 U2 100 $Tolerance $WarnTol } smallview diff --git a/tests/bugs/modalg_5/bug25043 b/tests/bugs/modalg_5/bug25043 index b605450e5b..856c4921b4 100644 --- a/tests/bugs/modalg_5/bug25043 +++ b/tests/bugs/modalg_5/bug25043 @@ -1,17 +1,16 @@ +puts "REQUIRED All: Info. Faulty shape if found in source shape" puts "============" puts "OCC25043" puts "============" puts "" -############################### +############################################################################################################################ ## there is no possibility to know what exactly subshape of source shape has detected problems by BRepAlgoAPI_Check -############################### +############################################################################################################################ pload QAcommands restore [locate_data_file bug25043.brep] a -decho off set info [OCC25043 a] -decho on if { [regexp "Faulty shape if found in source shape" ${info}] == 1 } { puts "OK : Good result" diff --git a/tests/bugs/modalg_5/bug25292_11 b/tests/bugs/modalg_5/bug25292_11 index 16038d3388..2b309bb45a 100644 --- a/tests/bugs/modalg_5/bug25292_11 +++ b/tests/bugs/modalg_5/bug25292_11 @@ -74,25 +74,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 ${U1} ${U2} 10 1e-7 + xdistcs c_$i s2 ${U1} ${U2} 10 1e-7 } v2d diff --git a/tests/bugs/modalg_5/bug25292_12 b/tests/bugs/modalg_5/bug25292_12 index d603d7e512..612f4e73ae 100644 --- a/tests/bugs/modalg_5/bug25292_12 +++ b/tests/bugs/modalg_5/bug25292_12 @@ -74,25 +74,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 ${U1} ${U2} 10 1e-7 + xdistcs c_$i s2 ${U1} ${U2} 10 1e-7 } v2d diff --git a/tests/bugs/modalg_5/bug25292_15 b/tests/bugs/modalg_5/bug25292_15 index 5d4d3d1faa..fe414df1eb 100644 --- a/tests/bugs/modalg_5/bug25292_15 +++ b/tests/bugs/modalg_5/bug25292_15 @@ -74,25 +74,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res s2 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res s1 ${U1} ${U2} 10 1e-7 + xdistcs res s2 ${U1} ${U2} 10 1e-7 } else { set ic 1 set AllowRepeate 1 @@ -114,25 +97,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 1 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 ${U1} ${U2} 10 1e-7 + xdistcs res_$ic s2 0 1 10 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug25292_16 b/tests/bugs/modalg_5/bug25292_16 index 62fb6b039b..7eaf3a70d0 100644 --- a/tests/bugs/modalg_5/bug25292_16 +++ b/tests/bugs/modalg_5/bug25292_16 @@ -75,25 +75,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res s2 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res s1 ${U1} ${U2} 10 1e-7 + xdistcs res s2 ${U1} ${U2} 10 1e-7 } else { set ic 1 set AllowRepeate 1 @@ -115,25 +98,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 1 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 ${U1} ${U2} 10 1e-7 + xdistcs res_$ic s2 0 1 10 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug25292_21 b/tests/bugs/modalg_5/bug25292_21 index 73af821249..f2312cddc2 100644 --- a/tests/bugs/modalg_5/bug25292_21 +++ b/tests/bugs/modalg_5/bug25292_21 @@ -71,25 +71,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 ${U1} ${U2} 10 1e-7 + xdistcs c_$i s2 ${U1} ${U2} 10 1e-7 } smallview diff --git a/tests/bugs/modalg_5/bug25292_22 b/tests/bugs/modalg_5/bug25292_22 index 6f9aa87781..8c2eb5ac00 100644 --- a/tests/bugs/modalg_5/bug25292_22 +++ b/tests/bugs/modalg_5/bug25292_22 @@ -71,25 +71,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 ${U1} ${U2} 10 1e-7 + xdistcs c_$i s2 ${U1} ${U2} 10 1e-7 } smallview diff --git a/tests/bugs/modalg_5/bug25292_25 b/tests/bugs/modalg_5/bug25292_25 index 1ca2d190b3..ac1987c964 100644 --- a/tests/bugs/modalg_5/bug25292_25 +++ b/tests/bugs/modalg_5/bug25292_25 @@ -75,25 +75,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res s2 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res s1 ${U1} ${U2} 10 1e-7 + xdistcs res s2 ${U1} ${U2} 10 1e-7 } else { set ic 1 set AllowRepeate 1 @@ -115,25 +98,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 1 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 ${U1} ${U2} 10 1e-7 + xdistcs res_$ic s2 0 1 10 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug25292_26 b/tests/bugs/modalg_5/bug25292_26 index eb41d95fe1..332ec45114 100644 --- a/tests/bugs/modalg_5/bug25292_26 +++ b/tests/bugs/modalg_5/bug25292_26 @@ -75,25 +75,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res s2 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res s1 ${U1} ${U2} 10 1e-7 + xdistcs res s2 ${U1} ${U2} 10 1e-7 } else { set ic 1 set AllowRepeate 1 @@ -115,25 +98,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 1 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 ${U1} ${U2} 10 1e-7 + xdistcs res_$ic s2 0 1 10 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug25292_31 b/tests/bugs/modalg_5/bug25292_31 index 482a52fb92..af2d11466e 100644 --- a/tests/bugs/modalg_5/bug25292_31 +++ b/tests/bugs/modalg_5/bug25292_31 @@ -65,25 +65,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-8 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-8 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 ${U1} ${U2} 10 1e-7 1e-8 + xdistcs c_$i s2 ${U1} ${U2} 10 1e-7 1e-8 } smallview diff --git a/tests/bugs/modalg_5/bug25292_32 b/tests/bugs/modalg_5/bug25292_32 index fa4492fe03..6fea9a4f6b 100644 --- a/tests/bugs/modalg_5/bug25292_32 +++ b/tests/bugs/modalg_5/bug25292_32 @@ -65,25 +65,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-8 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-8 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 ${U1} ${U2} 10 1e-7 1e-8 + xdistcs c_$i s2 ${U1} ${U2} 10 1e-7 1e-8 } smallview diff --git a/tests/bugs/modalg_5/bug25292_33 b/tests/bugs/modalg_5/bug25292_33 index e089f70b76..7fcd7aea75 100644 --- a/tests/bugs/modalg_5/bug25292_33 +++ b/tests/bugs/modalg_5/bug25292_33 @@ -70,25 +70,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-6 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res s2 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-6 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res s1 ${U1} ${U2} 10 1e-6 1e-7 + xdistcs res s2 ${U1} ${U2} 10 1e-6 1e-7 } else { set ic 1 set AllowRepeate 1 @@ -110,25 +93,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-6 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 1 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-6 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 ${U1} ${U2} 10 1e-6 1e-7 + xdistcs res_$ic s2 0 1 10 1e-6 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug25292_34 b/tests/bugs/modalg_5/bug25292_34 index 536cb00872..0266bbbed8 100644 --- a/tests/bugs/modalg_5/bug25292_34 +++ b/tests/bugs/modalg_5/bug25292_34 @@ -70,25 +70,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-6 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res s2 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-6 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res s1 ${U1} ${U2} 10 1e-6 1e-7 + xdistcs res s2 ${U1} ${U2} 10 1e-6 1e-7 } else { set ic 1 set AllowRepeate 1 @@ -110,25 +93,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-6 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 1 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-6 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 ${U1} ${U2} 10 1e-6 1e-7 + xdistcs res_$ic s2 0 1 10 1e-6 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug25292_35 b/tests/bugs/modalg_5/bug25292_35 index bd5998f1ba..aaea2c2c5a 100644 --- a/tests/bugs/modalg_5/bug25292_35 +++ b/tests/bugs/modalg_5/bug25292_35 @@ -62,25 +62,8 @@ while { $AllowRepeate != 0 } { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic s1 U1 U2 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 U1 U2 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 U1 U2 10 1e-7 + xdistcs res_$ic s2 U1 U2 10 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug25292_36 b/tests/bugs/modalg_5/bug25292_36 index 340567c185..52e3f20d69 100644 --- a/tests/bugs/modalg_5/bug25292_36 +++ b/tests/bugs/modalg_5/bug25292_36 @@ -77,25 +77,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res s2 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res s1 ${U1} ${U2} 10 1e-7 + xdistcs res s2 ${U1} ${U2} 10 1e-7 } else { set ic 1 set AllowRepeate 1 @@ -117,25 +100,8 @@ if {${ind} >= 0} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs res_$ic s1 ${U1} ${U2} 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 1 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 ${U1} ${U2} 10 1e-7 + xdistcs res_$ic s2 0 1 10 1e-7 incr ic } diff --git a/tests/bugs/modalg_5/bug25416_1 b/tests/bugs/modalg_5/bug25416_1 index 7331cbc774..8f3ce0678e 100644 --- a/tests/bugs/modalg_5/bug25416_1 +++ b/tests/bugs/modalg_5/bug25416_1 @@ -6,33 +6,6 @@ puts "" # Wrong section curve ####################################################################### -# Check if list of xdistcs-command is valid -proc checkList {List Tolerance D_good Limit_Tol} { - set L1 [llength ${List}] - set L2 10 - set L3 5 - set N [expr (${L1} - ${L2})/${L3} + 1] - - for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List} ${j1}] - set D [lindex ${List} ${j2}] - #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: T=${T} D=${D}" - } - - if { ${Tolerance} > ${Limit_Tol} } { - if { [expr abs(${D} - ${D_good})] > ${Limit_Tol} - && [expr abs(${D} - ${D_good})] <= ${Tolerance} } { - puts "Attention (critical value of tolerance) : T=${T} D=${D}" - } - } - } -} - - puts "##############################" puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" puts "##############################" @@ -98,25 +71,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 ${U1} ${U2} 10 1e-7 + xdistcs c_$i s2 ${U1} ${U2} 10 1e-7 } smallview diff --git a/tests/bugs/modalg_5/bug25416_2 b/tests/bugs/modalg_5/bug25416_2 index 8c56c3fda1..055e4f2282 100644 --- a/tests/bugs/modalg_5/bug25416_2 +++ b/tests/bugs/modalg_5/bug25416_2 @@ -6,32 +6,6 @@ puts "" # Wrong section curve ####################################################################### -# Check if list of xdistcs-command is valid -proc checkList {List Tolerance D_good Limit_Tol} { - set L1 [llength ${List}] - set L2 10 - set L3 5 - set N [expr (${L1} - ${L2})/${L3} + 1] - - for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List} ${j1}] - set D [lindex ${List} ${j2}] - #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: T=${T} D=${D}" - } - - if { ${Tolerance} > ${Limit_Tol} } { - if { [expr abs(${D} - ${D_good})] > ${Limit_Tol} - && [expr abs(${D} - ${D_good})] <= ${Tolerance} } { - puts "Attention (critical value of tolerance) : T=${T} D=${D}" - } - } - } -} - puts "##############################" puts "#!!!Search \"Attention\" keyword on this web-page for additional checking!!!" puts "##############################" @@ -101,25 +75,8 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 ${U1} ${U2} 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 ${U1} ${U2} 10 1e-7 + xdistcs c_$i s2 ${U1} ${U2} 10 1e-7 } smallview diff --git a/tests/bugs/modalg_5/bug25416_3 b/tests/bugs/modalg_5/bug25416_3 index 71e0546244..39c76766ed 100644 --- a/tests/bugs/modalg_5/bug25416_3 +++ b/tests/bugs/modalg_5/bug25416_3 @@ -22,11 +22,9 @@ foreach i $ll { foreach j $ll { if { $i >= $j } continue - decho off mkedge e1 $i mkedge e2 $j set coe [checkoverlapedges e1 e2] - decho on puts "$i<->$j: $coe" if { [regexp "Edges is not overlaped" $coe] != 1 } { @@ -35,8 +33,6 @@ foreach i $ll { } } -decho on - if { $status != 0 } { puts "Wrong section. Error with code $status" } else { diff --git a/tests/bugs/modalg_5/bug25488 b/tests/bugs/modalg_5/bug25488 index d3fb0b87f6..3437ecd6be 100644 --- a/tests/bugs/modalg_5/bug25488 +++ b/tests/bugs/modalg_5/bug25488 @@ -7,7 +7,6 @@ puts "" ###################################################### set Tolerance 1.1e-7 -set D_good 0. set Limit_Tol 1.0e-7 puts "##############################" @@ -24,17 +23,9 @@ set bug_info [intersect res sb1 sb2] set i 0 while {$i != [llength $bug_info]} { set res_i [lindex $bug_info $i] - dlog reset - dlog on - xdistcs ${res_i} sb1 0 1 10 - set BugLog [dlog get] - set BugList [split ${BugLog} {TD= \t\n}] - checkList ${BugList} ${Tolerance} ${D_good} ${Limit_Tol} - dlog reset - dlog on - xdistcs ${res_i} sb2 0 1 10 - set BugLog [dlog get] - set BugList [split ${BugLog} {TD= \t\n}] - checkList ${BugList} ${Tolerance} ${D_good} ${Limit_Tol} + + xdistcs ${res_i} sb1 0 1 10 ${Tolerance} ${Limit_Tol} + xdistcs ${res_i} sb2 0 1 10 ${Tolerance} ${Limit_Tol} + set i [expr {$i + 1}] } diff --git a/tests/bugs/modalg_5/bug25509_1 b/tests/bugs/modalg_5/bug25509_1 index 473d9a1117..33e77184a4 100755 --- a/tests/bugs/modalg_5/bug25509_1 +++ b/tests/bugs/modalg_5/bug25509_1 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1" puts "============" puts "OCC25509" puts "============" @@ -17,14 +18,6 @@ shape result so add b_1 result add b_1 result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25509_2 b/tests/bugs/modalg_5/bug25509_2 index 7f3f0487ca..2e1daad699 100755 --- a/tests/bugs/modalg_5/bug25509_2 +++ b/tests/bugs/modalg_5/bug25509_2 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1" puts "============" puts "OCC25509" puts "============" @@ -12,14 +13,6 @@ puts "" restore [locate_data_file bug25509_r7.brep] result invert result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25509_3 b/tests/bugs/modalg_5/bug25509_3 index 91c951710c..5182a76fcf 100755 --- a/tests/bugs/modalg_5/bug25509_3 +++ b/tests/bugs/modalg_5/bug25509_3 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1" puts "============" puts "OCC25509" puts "============" @@ -16,14 +17,6 @@ shape result so add b1_1 result add b2_1 result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25509_4 b/tests/bugs/modalg_5/bug25509_4 index 37a6bdf831..192cb17189 100755 --- a/tests/bugs/modalg_5/bug25509_4 +++ b/tests/bugs/modalg_5/bug25509_4 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1" puts "============" puts "OCC25509" puts "============" @@ -21,14 +22,6 @@ shape result so add b1_1 result add e2 result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25509_5 b/tests/bugs/modalg_5/bug25509_5 index b8ca0876f2..5fcb03373f 100755 --- a/tests/bugs/modalg_5/bug25509_5 +++ b/tests/bugs/modalg_5/bug25509_5 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1" puts "============" puts "OCC25509" puts "============" @@ -21,14 +22,6 @@ add b1_1 result add v1 result add v2 result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25509_6 b/tests/bugs/modalg_5/bug25509_6 index 4b1f7fab02..63e026d11b 100755 --- a/tests/bugs/modalg_5/bug25509_6 +++ b/tests/bugs/modalg_5/bug25509_6 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1" puts "============" puts "OCC25509" puts "============" @@ -34,14 +35,6 @@ add v2 result add b3_1 result add x result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25509_7 b/tests/bugs/modalg_5/bug25509_7 index 8962fe2d08..133bed1b4a 100755 --- a/tests/bugs/modalg_5/bug25509_7 +++ b/tests/bugs/modalg_5/bug25509_7 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1" puts "============" puts "OCC25509" puts "============" @@ -8,14 +9,6 @@ puts "" restore [locate_data_file bug25509_Aggreg_4.brep] result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25509_8 b/tests/bugs/modalg_5/bug25509_8 index 9a826f5c6c..bdc72af96a 100755 --- a/tests/bugs/modalg_5/bug25509_8 +++ b/tests/bugs/modalg_5/bug25509_8 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1" puts "============" puts "OCC25509" puts "============" @@ -8,14 +9,6 @@ puts "" restore [locate_data_file bug25509_r_6.brep] result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25697_2 b/tests/bugs/modalg_5/bug25697_2 index a41b690111..90b309dd17 100644 --- a/tests/bugs/modalg_5/bug25697_2 +++ b/tests/bugs/modalg_5/bug25697_2 @@ -37,25 +37,9 @@ mksurface s2 b2 for {set i 1} {$i <= ${NbCurv}} {incr i} { bounds c_$i u1 u2 dump u1 u2 - dlog reset - dlog on - xdistcs c_$i s1 u1 u2 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - dlog reset - dlog on - xdistcs c_$i s2 u1 u2 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 u1 u2 10 1e-7 + xdistcs c_$i s2 u1 u2 10 1e-7 } smallview diff --git a/tests/bugs/modalg_5/bug25735 b/tests/bugs/modalg_5/bug25735 index 88e7b3b252..d433d3cd2d 100644 --- a/tests/bugs/modalg_5/bug25735 +++ b/tests/bugs/modalg_5/bug25735 @@ -1,3 +1,4 @@ +puts "REQUIRED ALL: Faulty shapes in variables faulty_" puts "==========" puts "OCC25735" puts "==========" @@ -8,14 +9,6 @@ puts "" restore [locate_data_file bug25735_r5] result -decho off -set info [checkshape result] -decho on - -if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } { - puts "Error : There are no mistakes by checkshape-command" -} else { - puts "OK : There are mistakes by checkshape-command" -} +checkshape result set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25801 b/tests/bugs/modalg_5/bug25801 index 856201c731..192cac3f21 100755 --- a/tests/bugs/modalg_5/bug25801 +++ b/tests/bugs/modalg_5/bug25801 @@ -2,18 +2,12 @@ puts "=========" puts "CR25801" puts "=========" puts "" -############################### +######################################################################################### ## Some of the commands in BOPTest packages show the execution time without -t key -############################### +######################################################################################### box b1 10 10 10 - -dlog reset -dlog on -bopcheck b1 -set Log1 [dlog get] - -puts "${Log1}" +set Log1 [bopcheck b1] if { [regexp {Elapsed time} ${Log1}] } { puts "Error: bopcheck show the execution time without -t key" diff --git a/tests/bugs/modalg_6/bug25820_1 b/tests/bugs/modalg_6/bug25820_1 index 7ce786e317..be8c165e30 100644 --- a/tests/bugs/modalg_6/bug25820_1 +++ b/tests/bugs/modalg_6/bug25820_1 @@ -20,17 +20,9 @@ display b1 display b2 fit -dlog reset -dlog on -decho off -bopcurves b1 b2 -decho on -set bug_info [dlog get] - -set bug_info [string trim [string range $bug_info [expr {[string first "\n" $bug_info] + 1}] [expr {[string last "\n" $bug_info] - 1}]]] -set bug_info_tol [string trim [string range $bug_info [expr {[string first "=" $bug_info] + 1}] [expr {[string first "\n" $bug_info] - 1}]]] -set bug_info_cur [string trim [string range $bug_info [expr {[string first "\n" $bug_info] + 1}] [expr {[string length $bug_info] - 1}]]] -set bug_info_cur [string trim [string range $bug_info_cur 0 [expr {[string first " " $bug_info_cur] - 1}]]] +set info [bopcurves b1 b2] +regexp {Tolerance Reached=([-0-9.+eE]+)} $info full bug_info_tol +regexp {([0-9]+) curve\(s\) found.} $info full bug_info_cur if {$bug_info_tol > 1.0e-7} { puts "ERROR: OCC25820 is reproduced. Tolerance is to large ($bug_info_tol)." diff --git a/tests/bugs/modalg_6/bug25820_2 b/tests/bugs/modalg_6/bug25820_2 index 53c72e4dcf..4e87a559ee 100644 --- a/tests/bugs/modalg_6/bug25820_2 +++ b/tests/bugs/modalg_6/bug25820_2 @@ -20,17 +20,9 @@ display b1 display b2 fit -dlog reset -dlog on -decho off -bopcurves b1 b2 -decho on -set bug_info [dlog get] - -set bug_info [string trim [string range $bug_info [expr {[string first "\n" $bug_info] + 1}] [expr {[string last "\n" $bug_info] - 1}]]] -set bug_info_tol [string trim [string range $bug_info [expr {[string first "=" $bug_info] + 1}] [expr {[string first "\n" $bug_info] - 1}]]] -set bug_info_cur [string trim [string range $bug_info [expr {[string first "\n" $bug_info] + 1}] [expr {[string length $bug_info] - 1}]]] -set bug_info_cur [string trim [string range $bug_info_cur 0 [expr {[string first " " $bug_info_cur] - 1}]]] +set info [bopcurves b1 b2] +regexp {Tolerance Reached=([-0-9.+eE]+)} $info full bug_info_tol +regexp {([0-9]+) curve\(s\) found.} $info full bug_info_cur if {$bug_info_tol > 1.0e-7} { puts "ERROR: OCC25820 is reproduced. Tolerance is to large ($bug_info_tol)." diff --git a/tests/bugs/modalg_6/bug25820_3 b/tests/bugs/modalg_6/bug25820_3 index 216675f0cf..f3cf82a90c 100644 --- a/tests/bugs/modalg_6/bug25820_3 +++ b/tests/bugs/modalg_6/bug25820_3 @@ -20,17 +20,9 @@ display b1 display b2 fit -dlog reset -dlog on -decho off -bopcurves b1 b2 -decho on -set bug_info [dlog get] - -set bug_info [string trim [string range $bug_info [expr {[string first "\n" $bug_info] + 1}] [expr {[string last "\n" $bug_info] - 1}]]] -set bug_info_tol [string trim [string range $bug_info [expr {[string first "=" $bug_info] + 1}] [expr {[string first "\n" $bug_info] - 1}]]] -set bug_info_cur [string trim [string range $bug_info [expr {[string first "\n" $bug_info] + 1}] [expr {[string length $bug_info] - 1}]]] -set bug_info_cur [string trim [string range $bug_info_cur 0 [expr {[string first " " $bug_info_cur] - 1}]]] +set info [bopcurves b1 b2] +regexp {Tolerance Reached=([-0-9.+eE]+)} $info full bug_info_tol +regexp {([0-9]+) curve\(s\) found.} $info full bug_info_cur if {$bug_info_tol > 1.0e-7} { puts "ERROR: OCC25820 is reproduced. Tolerance is to large ($bug_info_tol)." diff --git a/tests/bugs/modalg_6/bug25844 b/tests/bugs/modalg_6/bug25844 index 74846f65df..6a80e1e795 100644 --- a/tests/bugs/modalg_6/bug25844 +++ b/tests/bugs/modalg_6/bug25844 @@ -1,3 +1,4 @@ +puts "REQUIRED All: checkshape failure" puts "================" puts "OCC25844" puts "================" @@ -7,18 +8,4 @@ puts "" ####################################################################### restore [locate_data_file bug25843_onewire.brep] b - -dlog reset -dlog on - checkshape b f - -set info [dlog get] -dlog reset -dlog off - -if { [regexp "checkshape failure" ${info}] != 1 } { - puts "Error : Command \"checkshape\" does not detect error for case when degenerated edge does not contain geometric representation." -} else { - puts "OK : Command \"checkshape\" work good" -} diff --git a/tests/bugs/modalg_6/bug26556_1 b/tests/bugs/modalg_6/bug26556_1 index 8fc715542c..229b04337f 100644 --- a/tests/bugs/modalg_6/bug26556_1 +++ b/tests/bugs/modalg_6/bug26556_1 @@ -1,3 +1,4 @@ +puts "REQUIRED All: ERROR. Degenerated normal on input data." puts "========" puts "OCC26556" puts "========" @@ -9,10 +10,5 @@ puts "" restore [locate_data_file OCC26556-004_extract_2015-01-C37_0216_res.brep] sh offsetparameter 1e-7 p i offsetload sh 300 -decho off -set bug_info [offsetperform r] -decho on -if {$bug_info != "ERROR. Degenerated normal on input data."} { - puts "ERROR: OCC26556 is reproduced. Error message is absent." -} +offsetperform r \ No newline at end of file diff --git a/tests/bugs/modalg_6/bug26556_2 b/tests/bugs/modalg_6/bug26556_2 index ca9077a1ba..60990bf6a5 100644 --- a/tests/bugs/modalg_6/bug26556_2 +++ b/tests/bugs/modalg_6/bug26556_2 @@ -1,3 +1,4 @@ +puts "REQUIRED All: ERROR. Degenerated normal on input data." puts "========" puts "OCC26556" puts "========" @@ -9,10 +10,5 @@ puts "" restore [locate_data_file OCC26556-004_extract_2015-01-C37_0240_res.brep] sh offsetparameter 1e-7 p i offsetload sh 400 -decho off -set bug_info [offsetperform r] -decho on -if {$bug_info != "ERROR. Degenerated normal on input data."} { - puts "ERROR: OCC26556 is reproduced. Error message is absent." -} +offsetperform r \ No newline at end of file diff --git a/tests/bugs/modalg_6/bug26556_3 b/tests/bugs/modalg_6/bug26556_3 index dd625dd130..7439201553 100644 --- a/tests/bugs/modalg_6/bug26556_3 +++ b/tests/bugs/modalg_6/bug26556_3 @@ -1,3 +1,4 @@ +puts "REQUIRED All: ERROR. Degenerated normal on input data." puts "========" puts "OCC26556" puts "========" @@ -9,10 +10,5 @@ puts "" restore [locate_data_file OCC26556-004_extract_2015-01-C37_0213_res.brep] sh offsetparameter 1e-7 p i offsetload sh 80 -decho off -set bug_info [offsetperform r] -decho on -if {$bug_info != "ERROR. Degenerated normal on input data."} { - puts "ERROR: OCC26556 is reproduced. Error message is absent." -} +offsetperform r \ No newline at end of file diff --git a/tests/bugs/modalg_6/bug26556_4 b/tests/bugs/modalg_6/bug26556_4 index 888a60abf7..050156b215 100644 --- a/tests/bugs/modalg_6/bug26556_4 +++ b/tests/bugs/modalg_6/bug26556_4 @@ -1,3 +1,4 @@ +puts "REQUIRED All: ERROR. Degenerated normal on input data." puts "========" puts "OCC26556" puts "========" @@ -10,10 +11,5 @@ restore [locate_data_file OCC26556-004_extract_2015-01-C37_0240_res.brep] sh explode sh F offsetparameter 1e-7 p i offsetload sh_3 300 -decho off -set bug_info [offsetperform r] -decho on -if {$bug_info != "ERROR. Degenerated normal on input data."} { - puts "ERROR: OCC26556 is reproduced. Error message is absent." -} +offsetperform r diff --git a/tests/bugs/modalg_6/bug26587 b/tests/bugs/modalg_6/bug26587 index edfc09ff45..971d1e9fcf 100644 --- a/tests/bugs/modalg_6/bug26587 +++ b/tests/bugs/modalg_6/bug26587 @@ -1,3 +1,4 @@ +puts "REQUIRED All: ERROR. Degenerated normal on input data" puts "========" puts "OCC26587" puts "========" @@ -12,13 +13,7 @@ restore [locate_data_file bug26587_plate.brep] plate offsetparameter 1e-7 p i offsetload plate 50 - -decho off - offsetperform r -decho on - fit - set only_screen_axo 1 diff --git a/tests/bugs/modalg_6/bug26636 b/tests/bugs/modalg_6/bug26636 index 1a86d4a9bd..df079c47b1 100644 --- a/tests/bugs/modalg_6/bug26636 +++ b/tests/bugs/modalg_6/bug26636 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Standard_ConstructionError\\: BRepFill \\:\\: profiles are inconsistent" puts "==========" puts "OCC26636" puts "==========" @@ -9,19 +10,4 @@ puts "" restore [locate_data_file bug26636_w1.brep] w1 restore [locate_data_file bug26636_w2.brep] w2 -decho off -dlog reset -dlog on - catch {thrusections result 0 1 w1 w2} - -set info [dlog get] -dlog reset -dlog off -decho on - -if { [regexp "Standard_ConstructionError\\: BRepFill \\:\\: profiles are inconsistent" ${info}] == 1 } { - puts "OK : Exeption is correct" -} else { - puts "Error : Exeption is not correct" -} diff --git a/tests/bugs/modalg_6/bug26687 b/tests/bugs/modalg_6/bug26687 index 059f001107..f1e054d5a5 100755 --- a/tests/bugs/modalg_6/bug26687 +++ b/tests/bugs/modalg_6/bug26687 @@ -1,4 +1,4 @@ -puts "REQUIRED: Error. mkplane has been finished with \"Not Planar\" status." +puts "REQUIRED ALL: Error. mkplane has been finished with \"Not Planar\" status." puts "========" puts "OCC26687" diff --git a/tests/bugs/moddata_1/buc61006 b/tests/bugs/moddata_1/buc61006 index f54d8a2a72..aa04683bcf 100755 --- a/tests/bugs/moddata_1/buc61006 +++ b/tests/bugs/moddata_1/buc61006 @@ -1,4 +1,4 @@ - +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "=========" puts "BUC61006" puts "=========" @@ -8,13 +8,8 @@ puts "" ######################################################### restore [locate_data_file buc61006.brep] result -decho off -set ch [checkshape result] -decho on -if {![string compare $ch "This shape seems to be valid"]} { - puts "Error : the checkshape command returns incorrect result." -} +checkshape result set 2dviewer 0 diff --git a/tests/bugs/moddata_1/bug161 b/tests/bugs/moddata_1/bug161 index 5de4f8cee1..8309b653ee 100755 --- a/tests/bugs/moddata_1/bug161 +++ b/tests/bugs/moddata_1/bug161 @@ -1,4 +1,4 @@ - +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "========" puts "OCC161" puts "========" @@ -11,14 +11,6 @@ puts "" restore [locate_data_file OCC161.brep] result -decho off -set che [checkshape result] -decho on - -if { [regexp {Faulty} $che] != 1 } { - puts "Faulty OCC161 : Checkshape command works wrongly" -} else { - puts "OCC161 OK : Checkshape command works properly" -} +checkshape result set 2dviewer 0 diff --git a/tests/bugs/moddata_1/bug203 b/tests/bugs/moddata_1/bug203 index 6e9c8de18b..b5bf3113d2 100755 --- a/tests/bugs/moddata_1/bug203 +++ b/tests/bugs/moddata_1/bug203 @@ -22,13 +22,11 @@ chamf result1 face edge_1 face_3 A ${radis} ${angle} explode result1 e -decho off if { [catch {fillet result result1 ${radis} result1_1 ${radis} result1_7 } catch_result] } { set mistake 1 } else { set mistake 0 } -decho on if { $mistake != 0} { puts "OK OCC203" diff --git a/tests/bugs/moddata_1/bug22043 b/tests/bugs/moddata_1/bug22043 index 67764cc1f2..340e0a5b27 100755 --- a/tests/bugs/moddata_1/bug22043 +++ b/tests/bugs/moddata_1/bug22043 @@ -1,25 +1,14 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "============" puts "OCC22043" puts "============" puts "" -####################################################################### +############################################################################################################# # Checkshape command does not return faulty shapes for the face. CAS63-sp10-*. Appendix to SALOME bug 002019 -####################################################################### +############################################################################################################# -set BugNumber OCC22043 - -puts "Load shape ..." restore [locate_data_file bug22043_f181.brep] result -decho off -set che [checkshape result] -decho on - -if {[regexp {Faulty} $che]} { - puts "OK ${BugNumber} : The face f181 can not be valid because at least it contain self-intersected wire" -} else { - puts "Faulty ${BugNumber} : The face f181 can not be valid because at least it contain self-intersected wire" -} - +checkshape result set 2dviewer 0 diff --git a/tests/bugs/moddata_1/bug22080 b/tests/bugs/moddata_1/bug22080 index bdf9f890fe..185c16aee4 100755 --- a/tests/bugs/moddata_1/bug22080 +++ b/tests/bugs/moddata_1/bug22080 @@ -1,5 +1,5 @@ puts "TODO OCC11111 ALL: Faulty OCC22080 : The face f contains degenerated edge that is far-fetched one" - +# puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "============" puts "OCC22080" puts "============" @@ -13,9 +13,7 @@ set BugNumber OCC22080 puts "Load shape ..." restore [locate_data_file bug22080_fx.brep] result -decho off set che [checkshape result] -decho on if {[regexp {Faulty} $che]} { puts "OK ${BugNumber} : The face f contains degenerated edge that is far-fetched one" diff --git a/tests/bugs/moddata_1/bug22165 b/tests/bugs/moddata_1/bug22165 index 14523402fa..9d3f158f67 100644 --- a/tests/bugs/moddata_1/bug22165 +++ b/tests/bugs/moddata_1/bug22165 @@ -1,3 +1,4 @@ +puts "REQUIRED All: 1 F: Syntax error in IGES file at line " puts "================" puts "OCC22165" puts "================" @@ -12,9 +13,7 @@ catch { pload XDE } igesbrep [locate_data_file OCC22165-cub_spain.igs] result * -decho off set Log [data c] -decho on set LogLength [llength ${Log}] diff --git a/tests/bugs/moddata_2/bug25 b/tests/bugs/moddata_2/bug25 index b949e02e00..3e7b7a00d7 100755 --- a/tests/bugs/moddata_2/bug25 +++ b/tests/bugs/moddata_2/bug25 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "================" puts "OCC25" puts "================" @@ -5,9 +6,7 @@ puts "" restore [locate_data_file OCC25-1.brep] sh1 -decho off set che [checkshape sh1] -decho on if { [regexp {Faulty} $che ] == 1 } { puts "Faulty OCC25 (case 1): Checkshape says that the wire on face has bad orientation, but it is not truth" @@ -18,9 +17,7 @@ if { [regexp {Faulty} $che ] == 1 } { # ================================================ restore [locate_data_file OCC25-2.brep] sh2 -decho off set che [checkshape sh2] -decho on if { [regexp {BRepCheck_BadOrientationOfSubshape} $che] && [regexp {BRepCheck_UnorientableShape} $che]} { puts " OCC25 (case 2) OK: Checkshape works properly" diff --git a/tests/bugs/moddata_2/bug278_3 b/tests/bugs/moddata_2/bug278_3 index 47e7df88e2..aa0dcec8ad 100755 --- a/tests/bugs/moddata_2/bug278_3 +++ b/tests/bugs/moddata_2/bug278_3 @@ -1,4 +1,4 @@ - +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "========" puts "OCC278" puts " (case 3)" @@ -14,13 +14,8 @@ puts "========" restore [locate_data_file OCC278c.brep] a mkplane result a -decho off -set che [checkshape result] -decho on -if { [regexp "Faulty" $che] != 1 } { - puts "Error (case 3) : Checkshape command works wrongly" -} +checkshape result set square 43.3075 set 2dviewer 0 diff --git a/tests/bugs/moddata_2/bug284 b/tests/bugs/moddata_2/bug284 index 37a6c9f636..99e6d937cd 100755 --- a/tests/bugs/moddata_2/bug284 +++ b/tests/bugs/moddata_2/bug284 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "========" puts "OCC284" puts "========" @@ -8,15 +9,7 @@ puts "========" restore [locate_data_file OCC284.brep] result -decho off if [catch { checkshape result } catch_result] { - set mistake 1 -} else { - set mistake 0 -} -decho on - -if { $mistake != 0} { puts "Faulty OCC284 : here is problem in checkshape function" } else { puts "OCC284 OK: function checkshape works properly" diff --git a/tests/bugs/moddata_2/bug325 b/tests/bugs/moddata_2/bug325 index 943aba96e2..db661b5ba4 100755 --- a/tests/bugs/moddata_2/bug325 +++ b/tests/bugs/moddata_2/bug325 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "========================" puts " OCC325 " puts "========================" @@ -8,14 +9,6 @@ puts "" restore [locate_data_file OCC325.brep] result -decho off -set che [checkshape result] -decho on - -if { [regexp {Faulty} $che ] != 1} { - puts "Faulty OCC325: Checkshape command works wrongly" -} else { - puts "OCC325 OK : Checkshape command works properly" -} +checkshape result set 2dviewer 0 diff --git a/tests/bugs/moddata_2/bug35 b/tests/bugs/moddata_2/bug35 index b2c088d48a..33c2fdb8ac 100755 --- a/tests/bugs/moddata_2/bug35 +++ b/tests/bugs/moddata_2/bug35 @@ -1,17 +1,12 @@ - +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "================" puts "OCC35" puts "================" puts "" restore [locate_data_file OCC35.brep] result -decho off -set info [checkshape result] -decho on -if { [regexp "Faulty" $info] != 1 } { - puts "Command checkshape works wrongly (should be faulty)" -} +checkshape result set 2dviewer 0 diff --git a/tests/bugs/moddata_2/bug366 b/tests/bugs/moddata_2/bug366 index 850e567f92..18c5313fc6 100755 --- a/tests/bugs/moddata_2/bug366 +++ b/tests/bugs/moddata_2/bug366 @@ -1,4 +1,4 @@ - +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "========================" puts " OCC366 " puts "========================" @@ -9,9 +9,7 @@ puts "" restore [locate_data_file buc61006.brep] result -decho off set che [checkshape result] -decho on if { [regexp "Faulty" $che] != 1 } { puts "Error : Checkshape command works wrongly" diff --git a/tests/bugs/moddata_2/bug3896 b/tests/bugs/moddata_2/bug3896 index f9135bf24b..231fa55bfa 100755 --- a/tests/bugs/moddata_2/bug3896 +++ b/tests/bugs/moddata_2/bug3896 @@ -35,9 +35,7 @@ for {set i 1} {$i <= 14} {incr i} { whatis a_$i } -decho off set info_result [checkshape result] -decho on if {[regexp {Faulty} $info_result] } { puts "OK ${BugNumber} : checkshape detect faulty faces in solid shape" diff --git a/tests/bugs/moddata_2/bug433 b/tests/bugs/moddata_2/bug433 index c87f9d7178..e5051a8ffe 100755 --- a/tests/bugs/moddata_2/bug433 +++ b/tests/bugs/moddata_2/bug433 @@ -2,15 +2,13 @@ puts "========================" puts " OCC433 " puts "========================" puts "" -######################################################### +######################################################################################### ## The attached face gives no errors in checkshape command in dev. However, it looks bad -######################################################### +######################################################################################### restore [locate_data_file OCC433.brep] result -decho off set err [checkshape result r] -decho on if { [regexp {OK} $err] == 1} { puts " Faulty OCC433: function CHECKSHAPE works wrongly" diff --git a/tests/bugs/moddata_2/bug438_1 b/tests/bugs/moddata_2/bug438_1 index d6a4b21eb8..0d4674a88f 100755 --- a/tests/bugs/moddata_2/bug438_1 +++ b/tests/bugs/moddata_2/bug438_1 @@ -1,23 +1,16 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "========" puts "OCC438" puts " (case 1)" puts "========" -#################################### +########################################################## ## Exception during checking of shape from OCC428 -#################################### +########################################################## restore [locate_data_file OCC428.brep] result -decho off if [catch { checkshape result } catch_result] { - set mistake 1 -} else { - set mistake 0 -} -decho on - -if { $mistake != 0} { puts "Faulty OCC438 (case 1): here is checking problem" } else { puts "OCC438 (case 1) OK" diff --git a/tests/bugs/moddata_2/bug441_1 b/tests/bugs/moddata_2/bug441_1 index 662ca47c9e..cdce87f3af 100755 --- a/tests/bugs/moddata_2/bug441_1 +++ b/tests/bugs/moddata_2/bug441_1 @@ -9,16 +9,12 @@ puts "" restore [locate_data_file OCC441a.brep] result -decho off set err [checkshape result r] -decho on set j 1 repeat 25 { restore [locate_data_file OCC441a.brep] result - decho off set err1 [checkshape result r] - decho on if { $err != $err1 } { puts [format " Faulty OCC441: function CHECKSHAPE works wrongly on %s time" $j] break diff --git a/tests/bugs/moddata_2/bug441_2 b/tests/bugs/moddata_2/bug441_2 index 56dfcc9015..4c62d59113 100755 --- a/tests/bugs/moddata_2/bug441_2 +++ b/tests/bugs/moddata_2/bug441_2 @@ -9,16 +9,12 @@ puts "" restore [locate_data_file OCC441b.brep] result -decho off set err [checkshape result r] -decho on set j 1 repeat 25 { restore [locate_data_file OCC441b.brep] result - decho off set err1 [checkshape result r] - decho on if { $err != $err1 } { puts [format " Faulty OCC441: function CHECKSHAPE works wrongly on %s time" $j] break diff --git a/tests/bugs/moddata_2/bug441_3 b/tests/bugs/moddata_2/bug441_3 index 3689d15dd9..524ceadaf2 100755 --- a/tests/bugs/moddata_2/bug441_3 +++ b/tests/bugs/moddata_2/bug441_3 @@ -9,16 +9,12 @@ puts "" restore [locate_data_file OCC441c.brep] result -decho off set err [checkshape result r] -decho on set j 1 repeat 25 { restore [locate_data_file OCC441c.brep] result - decho off set err1 [checkshape result r] - decho on if { $err != $err1 } { puts [format " Faulty OCC441: function CHECKSHAPE works wrongly on %s time" $j] break diff --git a/tests/bugs/moddata_2/bug525 b/tests/bugs/moddata_2/bug525 index 57a6051651..60794dae81 100755 --- a/tests/bugs/moddata_2/bug525 +++ b/tests/bugs/moddata_2/bug525 @@ -1,23 +1,19 @@ +puts "REQUIRED All: OCC525 Exception" + pload QAcommands puts "========" puts "OCC525" puts "========" puts "" -######################################### +######################################################## ## Bug in GeomPlate_BuildPlateSurface::ComputeSurfInit() -######################################### +######################################################## set mistake 0 -decho off if { [catch { OCC525 } ] } { - set mistake 1 -} -decho on - -if { $mistake == 1 } { - puts "Faulty : OCC525" + puts "Faulty : OCC525" } set 2dviewer 1 diff --git a/tests/bugs/moddata_2/bug592 b/tests/bugs/moddata_2/bug592 index dd05d32f68..7f82f08039 100755 --- a/tests/bugs/moddata_2/bug592 +++ b/tests/bugs/moddata_2/bug592 @@ -30,9 +30,7 @@ puts "the tolerance of the edge is $MaxEdgeTolerance" puts "the tolerance is less than distance between point and surface" puts "BUT" -decho off set che [checkshape ff114] -decho on if { [regexp {Faulty} $che] != 1 } { puts "Faulty OCC592 : Checkshape BRepCheck_Analyzer does not detect faulty shape" diff --git a/tests/bugs/moddata_2/bug6862_1 b/tests/bugs/moddata_2/bug6862_1 index c7c40679cc..5b09a84373 100755 --- a/tests/bugs/moddata_2/bug6862_1 +++ b/tests/bugs/moddata_2/bug6862_1 @@ -12,9 +12,7 @@ set BugNumber OCC6862 restore [locate_data_file OCC497a.brep] a_1 restore [locate_data_file OCC497b.brep] a_2 -decho off set resstr [bopargcheck a_2] -decho on if {$resstr=="Faulties, that can not be treated by BOP, are detected.\n"} { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug6862_2 b/tests/bugs/moddata_2/bug6862_2 index b390a3a97e..7cc95e7ee2 100755 --- a/tests/bugs/moddata_2/bug6862_2 +++ b/tests/bugs/moddata_2/bug6862_2 @@ -12,9 +12,7 @@ set BugNumber OCC6862 restore [locate_data_file OCC497e.brep] a_1 restore [locate_data_file OCC497f.brep] a_2 -decho off set resstr [bopargcheck a_2] -decho on if {$resstr=="Faulties, that can not be treated by BOP, are detected.\n"} { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug6862_3 b/tests/bugs/moddata_2/bug6862_3 index 5e7b098ec0..42d2e98eaa 100755 --- a/tests/bugs/moddata_2/bug6862_3 +++ b/tests/bugs/moddata_2/bug6862_3 @@ -13,9 +13,8 @@ restore [locate_data_file OCC651a.brep] a restore [locate_data_file OCC651b.brep] b puts "Checking shapes: bopargcheck a b /FTVEIP ..." -decho off + set resstr [bopargcheck a b /FTVEIP] -decho on if {$resstr=="Faulties, that can not be treated by BOP, are detected.\n"} { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug6862_4 b/tests/bugs/moddata_2/bug6862_4 index f59ccdb1a4..335af4c1a5 100755 --- a/tests/bugs/moddata_2/bug6862_4 +++ b/tests/bugs/moddata_2/bug6862_4 @@ -11,10 +11,8 @@ set BugNumber OCC6862 # test small edges restore [locate_data_file OCC651a.brep] a -decho off puts "Checking shapes: bopargcheck a b /FTVEIP ..." set resstr [bopargcheck a /FTVEIP] -decho on if {$resstr=="Faulties, that can not be treated by BOP, are detected.\n"} { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug6862_5 b/tests/bugs/moddata_2/bug6862_5 index 738b2a7ce7..ab9ec3fd61 100755 --- a/tests/bugs/moddata_2/bug6862_5 +++ b/tests/bugs/moddata_2/bug6862_5 @@ -13,9 +13,7 @@ box b1 10 20 10 box b2 20 10 10 explode b2 f -decho off set resstr [bopargcheck b1 b2_1 -C /RFTVEI] -decho on if {$resstr=="Faulties, that can not be treated by BOP, are detected.\n"} { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug6862_6 b/tests/bugs/moddata_2/bug6862_6 index 8152b30675..7b5d010b4f 100755 --- a/tests/bugs/moddata_2/bug6862_6 +++ b/tests/bugs/moddata_2/bug6862_6 @@ -13,9 +13,7 @@ set BugNumber OCC6862 restore [locate_data_file OCC726.brep] a explode a -decho off set resstr [bopargcheck a_1 a_2 -O /FTVEI] -decho on if {$resstr=="Faulties, that can not be treated by BOP, are detected.\n"} { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug6862_7 b/tests/bugs/moddata_2/bug6862_7 index 5ea0d6d597..13111ac131 100755 --- a/tests/bugs/moddata_2/bug6862_7 +++ b/tests/bugs/moddata_2/bug6862_7 @@ -22,9 +22,7 @@ mkface ff gs add r1_1 ff add r2_1 ff -decho off set resstr [bopargcheck ff b2_6 -F /RTVEIP] -decho on if {$resstr=="Faulties, that can not be treated by BOP, are detected.\n"} { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug6862_8 b/tests/bugs/moddata_2/bug6862_8 index 80f386f041..ff28255882 100755 --- a/tests/bugs/moddata_2/bug6862_8 +++ b/tests/bugs/moddata_2/bug6862_8 @@ -17,9 +17,7 @@ tcopy b2_10 ee2 compound b2_10 ee2 comp donl b1_10 comp -decho off set resstr [bopargcheck b1_10 comp -O /RFTEIP] -decho on if {$resstr=="Faulties, that can not be treated by BOP, are detected.\n"} { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug6862_9 b/tests/bugs/moddata_2/bug6862_9 index 4f790dcd86..b68b8cf040 100755 --- a/tests/bugs/moddata_2/bug6862_9 +++ b/tests/bugs/moddata_2/bug6862_9 @@ -17,9 +17,7 @@ tcopy b2_10 ee2 wire ww b2_10 ee2 donl b1_10 ww -decho off set resstr [bopargcheck b1_10 ww -O /RFTVIP] -decho on if { $resstr=="Faulties, that can not be treated by BOP, are detected.\n" } { puts "OK ${BugNumber}" diff --git a/tests/bugs/moddata_2/bug736 b/tests/bugs/moddata_2/bug736 index 5507ea2327..4af969dc70 100755 --- a/tests/bugs/moddata_2/bug736 +++ b/tests/bugs/moddata_2/bug736 @@ -2,15 +2,15 @@ puts "========" puts "OCC736" puts "========" puts "" -##################################################### +################################################################################### ## After restoring attached shape(face) it is obviously that there is ## selfintersecting wire. However BRepCheck gives reply that shape looks OK. -##################################################### +################################################################################### restore [locate_data_file OCC736.brep] result -decho off + set che [checkshape result r] -decho on + if { [regexp {OK} $che ] == 1 } { puts "Faulty OCC736: checkshape command works wrongly" } else { diff --git a/tests/bugs/moddata_2/bug889 b/tests/bugs/moddata_2/bug889 index 4be5dd3b33..1eb631cfd0 100755 --- a/tests/bugs/moddata_2/bug889 +++ b/tests/bugs/moddata_2/bug889 @@ -1,22 +1,13 @@ -puts "TODO OCC12345 ALL: Faulty OCC889 : Checkshape says that the shape has FAULTY, but it is not truth" - +puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_" puts "============" puts "OCC889" puts "============" puts "" -############################################ +#################################################################### ## Checkshape founds number of errors on new face. It is not true. -############################################ +#################################################################### restore [locate_data_file OCC889.rle] result -decho off -set che [checkshape result] -decho on - -if { [ regexp {Faulty} $che ] == 1 } { - puts "Faulty OCC889 : Checkshape says that the shape has FAULTY, but it is not truth" -} else { - puts "OCC889 OK : Checkshape works properly" -} +checkshape result set 2dviewer 0 diff --git a/tests/bugs/moddata_2/bug9303_1 b/tests/bugs/moddata_2/bug9303_1 index f4de3efb08..96a5e2ef1a 100755 --- a/tests/bugs/moddata_2/bug9303_1 +++ b/tests/bugs/moddata_2/bug9303_1 @@ -17,13 +17,11 @@ fit line ll 0 0 10 1 0 0 -decho off if [catch {intersect res ll nc} result] { set mistake 1 } else { set mistake 0 } -decho on if { $mistake == 0} { puts "${BugNumber} OK : intersection was finished" diff --git a/tests/bugs/moddata_2/bug935_1 b/tests/bugs/moddata_2/bug935_1 index 07ddf00b74..0f3c13b40d 100755 --- a/tests/bugs/moddata_2/bug935_1 +++ b/tests/bugs/moddata_2/bug935_1 @@ -1,4 +1,4 @@ - +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "=========" puts " OCC935 " puts "(case 1)" @@ -10,20 +10,17 @@ puts "" restore [locate_data_file OCC935_1.brep] result -decho off set err [checkshape result] -decho on + set j 1 repeat 25 { restore [locate_data_file OCC935_1.brep] result - decho off set err1 [checkshape result] - decho on if { $err != $err1 } { - puts [format " Faulty OCC935 (case 1): function CHECKSHAPE works wrongly on %s time" $j] - break + puts [format " Faulty OCC935 (case 1): function CHECKSHAPE works wrongly on %s time" $j] + break } else { - puts [format " OCC935 (case 1) OK: function CHECKSHAPE works properly %s time" $j] + puts [format " OCC935 (case 1) OK: function CHECKSHAPE works properly %s time" $j] } incr j } diff --git a/tests/bugs/moddata_2/bug935_2 b/tests/bugs/moddata_2/bug935_2 index 7f738a4c26..3e4d374d3b 100755 --- a/tests/bugs/moddata_2/bug935_2 +++ b/tests/bugs/moddata_2/bug935_2 @@ -1,4 +1,4 @@ - +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "=========" puts " OCC935 " puts "(case 2)" @@ -10,16 +10,12 @@ puts "" restore [locate_data_file OCC935_2.brep] result -decho off set err [checkshape result] -decho on set j 1 repeat 25 { restore [locate_data_file OCC935_2.brep] result - decho off set err1 [checkshape result] - decho on if { $err != $err1 } { puts [format " Faulty OCC935 (case 2): function CHECKSHAPE works wrongly on %s time" $j] break diff --git a/tests/bugs/moddata_2/bug943_1 b/tests/bugs/moddata_2/bug943_1 index 4ee1a39ae1..05b0ad3988 100755 --- a/tests/bugs/moddata_2/bug943_1 +++ b/tests/bugs/moddata_2/bug943_1 @@ -1,4 +1,4 @@ - +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_" puts "=========" puts " OCC943 " puts "(case 1)" @@ -13,16 +13,12 @@ puts "" restore [locate_data_file OCC943_1.brep] result -decho off set err [checkshape result] -decho on set j 1 repeat 25 { restore [locate_data_file OCC943_1.brep] result - decho off set err1 [checkshape result] - decho on if { $err != $err1 } { puts [format " Faulty OCC943 (case 1): function CHECKSHAPE works wrongly on %s time" $j] break diff --git a/tests/bugs/moddata_2/bug956_1 b/tests/bugs/moddata_2/bug956_1 index 10edaf1033..ee4763d589 100755 --- a/tests/bugs/moddata_2/bug956_1 +++ b/tests/bugs/moddata_2/bug956_1 @@ -10,15 +10,7 @@ puts "" restore [locate_data_file OCC956_1.brep] result -decho off -set che [checkshape result] -decho on - -if { [regexp {Faulty} $che] } { - puts "Faulty OCC956 (case 1): Checkshape says that the shape is incorrect, but it is not truth" -} else { - puts "OCC956 OK (case 1): Checkshape works properly" -} +checkshape result set 2dviewer 0 diff --git a/tests/bugs/moddata_2/bug956_2 b/tests/bugs/moddata_2/bug956_2 index ddf1876fef..0e71b78c1f 100755 --- a/tests/bugs/moddata_2/bug956_2 +++ b/tests/bugs/moddata_2/bug956_2 @@ -10,15 +10,7 @@ puts "" restore [locate_data_file OCC956_2.brep] result -decho off -set che [checkshape result] -decho on - -if { [regexp {Faulty} $che] } { - puts "Faulty OCC956 (case 2): Checkshape says that the shape is incorrect, but it is not truth" -} else { - puts "OCC956 OK (case 2): Checkshape works properly" -} +checkshape result set 2dviewer 0 diff --git a/tests/bugs/moddata_3/buc60811 b/tests/bugs/moddata_3/buc60811 index ea558f1ef7..c1b5cf654d 100644 --- a/tests/bugs/moddata_3/buc60811 +++ b/tests/bugs/moddata_3/buc60811 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Error is 5" puts "========================" puts "BUC60811" puts "========================" @@ -5,15 +6,6 @@ puts "========================" pload QAcommands vinit -decho off + set List [BUC60811] -decho on -if { [regexp "Error is 5" $List] != 1 } { - puts "Faulty: output is incorrect" -} else { - puts "OK: output is correct" -} - - - diff --git a/tests/bugs/moddata_3/bug23981 b/tests/bugs/moddata_3/bug23981 index d6bfaa1d31..55b34beb02 100755 --- a/tests/bugs/moddata_3/bug23981 +++ b/tests/bugs/moddata_3/bug23981 @@ -12,57 +12,10 @@ restore [locate_data_file bug23981_s2.draw] s2 intersect i s1 s2 puts "First test" -dlog reset -dlog on -xdistcs i_1 s1 0 1 100 -set Log1 [dlog get] - -set List1 [split ${Log1} {TD= \t\n}] - -set L1 [llength ${List1}] -set L2 10 -set L3 5 -set N [expr (${L1} - ${L2})/${L3} + 1] -set Tolerance 1.0e-5 -set D_good 0. - -for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List1} ${j1}] - set D [lindex ${List1} ${j2}] - #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" - } -} - +xdistcs i_1 s1 0 1 100 1e-5 puts "Second test" -dlog reset -dlog on -xdistcs i_2 s1 0 1 100 -set Log2 [dlog get] - -set List2 [split ${Log2} {TD= \t\n}] - -set L1 [llength ${List2}] -set L2 10 -set L3 5 -set N [expr (${L1} - ${L2})/${L3} + 1] -set Tolerance 1.0e-5 -set D_good 0. - -for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List2} ${j1}] - set D [lindex ${List2} ${j2}] - #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" - } -} +xdistcs i_2 s1 0 1 100 1e-5 smallview fit diff --git a/tests/bugs/moddata_3/bug24142 b/tests/bugs/moddata_3/bug24142 index 8f06da607f..553e049b8c 100755 --- a/tests/bugs/moddata_3/bug24142 +++ b/tests/bugs/moddata_3/bug24142 @@ -15,15 +15,10 @@ mksurface s2 sh_5 trim st1 s1 0 6.28318530717959 0 74.9999999999999 trim st2 s2 0 6.28318530717959 -74.0551172696384 125.944882730362 -intersect i st1 st2 +intersect cur st1 st2 -dlog reset -dlog on -xdistcs i st2 0 1 10 -set log_on [dlog get] - -if { [regexp "i is null curve" ${log_on}] != 1 } { - puts "Error : Wrong section curve" +if { [regexp -nocase "curve" [whatis cur]] } { + puts "Error: intersection curve is built while it should not" } set 2dviewer 1 diff --git a/tests/bugs/moddata_3/bug24427_1 b/tests/bugs/moddata_3/bug24427_1 index bb686d7db7..0fc255810c 100644 --- a/tests/bugs/moddata_3/bug24427_1 +++ b/tests/bugs/moddata_3/bug24427_1 @@ -19,58 +19,10 @@ explode ressec e mkcurve rr ressec_1 puts "First test" -dlog reset -dlog on -xdistcs rr s1 0 1 100 - -set Log1 [dlog get] - -set List1 [split ${Log1} {TD= \t\n}] - -set L1 [llength ${List1}] -set L2 10 -set L3 5 -set N [expr (${L1} - ${L2})/${L3} + 1] -set Tolerance 1.0e-7 -set D_good 0. - -for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List1} ${j1}] - set D [lindex ${List1} ${j2}] - puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" - } -} - +xdistcs rr s1 0 1 100 1e-7 puts "Second test" -dlog reset -dlog on -xdistcs rr s2 0 1 100 -set Log2 [dlog get] - -set List2 [split ${Log2} {TD= \t\n}] - -set L1 [llength ${List2}] -set L2 10 -set L3 5 -set N [expr (${L1} - ${L2})/${L3} + 1] -set Tolerance 1.0e-7 -set D_good 0. - -for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List2} ${j1}] - set D [lindex ${List2} ${j2}] - puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" - } -} +xdistcs rr s2 0 1 100 1e-7 donly rr s1t s2t diff --git a/tests/bugs/moddata_3/bug24427_2 b/tests/bugs/moddata_3/bug24427_2 index abf41c2c97..a3d2f1c3d6 100644 --- a/tests/bugs/moddata_3/bug24427_2 +++ b/tests/bugs/moddata_3/bug24427_2 @@ -19,58 +19,10 @@ intersect i s1t s2t don s1t s2t i puts "First test" -dlog reset -dlog on -xdistcs i s1 0 1 10 - -set Log1 [dlog get] - -set List1 [split ${Log1} {TD= \t\n}] - -set L1 [llength ${List1}] -set L2 10 -set L3 5 -set N [expr (${L1} - ${L2})/${L3} + 1] -set Tolerance 1.0e-7 -set D_good 0. - -for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List1} ${j1}] - set D [lindex ${List1} ${j2}] - puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" - } -} - +xdistcs i s1 0 1 10 1e-7 puts "Second test" -dlog reset -dlog on -xdistcs i s2 0 1 10 -set Log2 [dlog get] - -set List2 [split ${Log2} {TD= \t\n}] - -set L1 [llength ${List2}] -set L2 10 -set L3 5 -set N [expr (${L1} - ${L2})/${L3} + 1] -set Tolerance 1.0e-7 -set D_good 0. - -for {set i 1} {${i} <= ${N}} {incr i} { - set j1 [expr ${L2} + (${i}-1)*${L3}] - set j2 [expr ${j1} + 2] - set T [lindex ${List2} ${j1}] - set D [lindex ${List2} ${j2}] - puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}" - if { [expr abs(${D} - ${D_good})] > ${Tolerance} } { - puts "Error: i=${i} T=${T} D=${D}" - } -} +xdistcs i s2 0 1 10 1e-7 donly i s1t s2t diff --git a/tests/bugs/moddata_3/bug25109 b/tests/bugs/moddata_3/bug25109 index ac7932c829..e851bd4430 100644 --- a/tests/bugs/moddata_3/bug25109 +++ b/tests/bugs/moddata_3/bug25109 @@ -1,3 +1,4 @@ +puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_1 " puts "============" puts "CR25109" puts "============" @@ -8,12 +9,4 @@ puts "" restore [locate_data_file bug25109_e1.brep] b -decho off -set info [checkshape b] -decho on - -if { [regexp "This shape seems to be valid" ${info}] == 1 } { - puts "Error: checkshape is incorrect" -} else { - puts "OK: checkshape is correct" -} +checkshape b diff --git a/tests/bugs/moddata_3/bug25782_1 b/tests/bugs/moddata_3/bug25782_1 index af4822b215..879676da0c 100755 --- a/tests/bugs/moddata_3/bug25782_1 +++ b/tests/bugs/moddata_3/bug25782_1 @@ -33,25 +33,8 @@ while { $AllowRepeate != 0 } { if {${ind} < 0} { set AllowRepeate 0 } else { - dlog reset - dlog on - xdistcs res_$ic s1 0 100 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 100 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 0 100 10 1e-7 + xdistcs res_$ic s2 0 100 10 1e-7 incr ic } @@ -82,23 +65,6 @@ for {set i 1} {$i <= ${NbCurv}} {incr i} { puts "Error: Wrong curve's range!" } - dlog reset - dlog on - xdistcs c_$i s1 U1 U2 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs c_$i s2 U1 U2 10 - set Log2 [dlog get] - set List2 [split ${Log2} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List2} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs c_$i s1 U1 U2 10 1e-7 + xdistcs c_$i s2 U1 U2 10 1e-7 } diff --git a/tests/bugs/moddata_3/bug25782_2 b/tests/bugs/moddata_3/bug25782_2 index e889d35d24..a54a2915f8 100755 --- a/tests/bugs/moddata_3/bug25782_2 +++ b/tests/bugs/moddata_3/bug25782_2 @@ -43,25 +43,8 @@ while { $AllowRepeate != 0 } { puts "Error : Bad intersection" } - dlog reset - dlog on - xdistcs res_$ic s1 0 100 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} - - dlog reset - dlog on - xdistcs res_$ic s2 0 100 10 - set Log1 [dlog get] - set List1 [split ${Log1} {TD= \t\n}] - set Tolerance 1.0e-7 - set Limit_Tol 1.0e-7 - set D_good 0. - checkList ${List1} ${Tolerance} ${D_good} ${Limit_Tol} + xdistcs res_$ic s1 0 100 10 1e-7 + xdistcs res_$ic s2 0 100 10 1e-7 incr ic } diff --git a/tests/bugs/moddata_3/bug26038_1 b/tests/bugs/moddata_3/bug26038_1 index 44e2bcb7d1..16e6df76e3 100755 --- a/tests/bugs/moddata_3/bug26038_1 +++ b/tests/bugs/moddata_3/bug26038_1 @@ -27,13 +27,4 @@ set tol_abs 1.0e-6 set tol_rel 1.0e-6 checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel} -dlog reset -dlog on -xdistcs c s 3.140212946671221 3.142972360508366 10 -set Log [dlog get] - -set List [split ${Log} {TD= \t\n}] -set Tolerance 1.0e-6 -set D_good 0. -set Limit_Tol 1.0e-6 -checkList ${List} ${Tolerance} ${D_good} ${Limit_Tol} +xdistcs c s 3.140212946671221 3.142972360508366 10 1e-6 diff --git a/tests/bugs/moddata_3/bug26038_2 b/tests/bugs/moddata_3/bug26038_2 index f39adbff8a..b1359cdf5f 100755 --- a/tests/bugs/moddata_3/bug26038_2 +++ b/tests/bugs/moddata_3/bug26038_2 @@ -19,13 +19,4 @@ set tol_abs 1.0e-6 set tol_rel 1.0e-6 checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel} -dlog reset -dlog on -xdistcs c s 1.57079 1.5708 10 -set Log [dlog get] - -set List [split ${Log} {TD= \t\n}] -set Tolerance 1.0e-6 -set D_good 0. -set Limit_Tol 1.0e-6 -checkList ${List} ${Tolerance} ${D_good} ${Limit_Tol} +xdistcs c s 1.57079 1.5708 10 1e-6 diff --git a/tests/bugs/step/bug11856 b/tests/bugs/step/bug11856 index ed60243c47..6ee661470a 100755 --- a/tests/bugs/step/bug11856 +++ b/tests/bugs/step/bug11856 @@ -9,9 +9,7 @@ puts "" set BugNumber OCC11856 -decho off stepread [locate_data_file OCC11856.stp] a * -decho on tpcompound result diff --git a/tests/bugs/step/bug16351 b/tests/bugs/step/bug16351 index 7522b7e1b8..b52a459a99 100755 --- a/tests/bugs/step/bug16351 +++ b/tests/bugs/step/bug16351 @@ -6,7 +6,4 @@ puts "" # Crash in ShapeFix_Edge::FixAddPCurve ####################################################################### -decho off stepread [locate_data_file OCC16351.step] a * -decho on - diff --git a/tests/bugs/step/bug22145 b/tests/bugs/step/bug22145 index 21f1d32bf9..a163d20eca 100755 --- a/tests/bugs/step/bug22145 +++ b/tests/bugs/step/bug22145 @@ -8,9 +8,7 @@ puts "" # Incorrect cutting BRepMesh_FastDiscretFace ####################################################################### -decho off stepread [locate_data_file OCC22145.stp] a * -decho on tpcompound result diff --git a/tests/bugs/vis/bug23153 b/tests/bugs/vis/bug23153 index cad4751fa3..0188ab7ed2 100755 --- a/tests/bugs/vis/bug23153 +++ b/tests/bugs/vis/bug23153 @@ -1,3 +1,4 @@ +puts "REQUIRED All: \\*\\*\\* Error on Record" puts "============" puts "OCC23153" puts "============" @@ -10,9 +11,9 @@ pload XDE set BugNumber OCC23153 set TheFileName OCC23153-long_furrowed_shape.stp -decho off + stepread [locate_data_file $TheFileName] a * -decho on + tpcompound result set square 14684.4 diff --git a/tests/bugs/vis/bug26029 b/tests/bugs/vis/bug26029 index 162b5d3d90..d61a6857cb 100644 --- a/tests/bugs/vis/bug26029 +++ b/tests/bugs/vis/bug26029 @@ -21,9 +21,6 @@ vsetdispmode 1 vdefaults -defl 1.0 -autoTriang off vdisplay s -# disable output of commands -decho off - set aNb1 100 # display 100x100 connected instances of single presentation diff --git a/tests/bugs/vis/bug316 b/tests/bugs/vis/bug316 index cf90249b2d..8244fcda1e 100755 --- a/tests/bugs/vis/bug316 +++ b/tests/bugs/vis/bug316 @@ -2,23 +2,13 @@ puts "================" puts "OCC316" puts "================" puts "" - -######################################################## +######################################################################### ## Exception is raised in the application during visualization. (#2054) -######################################################## +######################################################################### restore [locate_data_file OCC316.brep] result -decho off -set che [checkshape result] -decho on - -if { [regexp "Faulty" $che] == 1 } { - puts "Warning OCC316: Source shape is NOT correct. It was detected by Checkshape command" -} - tclean result - vinit vdisplay result vsetdispmode result 1 diff --git a/tests/bugs/vis/bug319 b/tests/bugs/vis/bug319 index c012bceaba..e8b4e731f1 100755 --- a/tests/bugs/vis/bug319 +++ b/tests/bugs/vis/bug319 @@ -10,14 +10,6 @@ cpulimit 3500 restore [locate_data_file OCC319.brep] result -decho off -set res [checkshape result] -decho on -set index [lsearch $res Faulty] -if {$index > -1} { - puts "Warning OCC319: here is checkshape problem" -} - tclean result vinit vdisplay result @@ -41,10 +33,8 @@ set info [trinfo result] regexp { +([-0-9.+eE]+) +triangles} $info full tri regexp { +([-0-9.+eE]+) +nodes} $info full nod -set IsGood 1 if { $tri == 0 || $nod == 0 } { puts "Faulty OCC319: here is shading problem" - set IsGood 0 } regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full sq @@ -59,11 +49,6 @@ puts "square_percent = ${square_percent}" if {${square_percent} > ${percent_max}} { puts "OCC319 Faulty : here is square problem" - set IsGood 0 -} - -if {${IsGood} != 1} { - puts "Errpr : OCC319" } set only_screen 1 diff --git a/tests/bugs/xde/bug24759 b/tests/bugs/xde/bug24759 index b8be26c162..263b05cfc6 100644 --- a/tests/bugs/xde/bug24759 +++ b/tests/bugs/xde/bug24759 @@ -6,7 +6,6 @@ puts "" # Crash on STEP import, when reading a file exported is non-"C" locale ########################################################################## -decho off stepread [locate_data_file bug24759_FissionMeter.step] aaa f * diff --git a/tests/bugs/xde/bug25176 b/tests/bugs/xde/bug25176 index be599fdcef..1ff038df69 100644 --- a/tests/bugs/xde/bug25176 +++ b/tests/bugs/xde/bug25176 @@ -6,12 +6,8 @@ puts "" # STEP Reader - no error report if referenced entity has wrong type ###################################################################### - stepread [locate_data_file bug25176_occ25176.stp] step * - -decho off set Log [data c] -decho on if {![regexp {F:APPLICATION_PROTOCOL_DEFINITION: Parameter n0.4} $Log]} { puts "Error: wrong report on wrong type entity" diff --git a/tests/bugs/xde/bug25357 b/tests/bugs/xde/bug25357 index 758bedc503..d1f4570643 100644 --- a/tests/bugs/xde/bug25357 +++ b/tests/bugs/xde/bug25357 @@ -15,15 +15,11 @@ set anASCIImode 0 ptorus res 10 8 incmesh res 0.5 -#decho off set LogBefore [trinfo res] -#decho on writestl res ${aFile} ${anASCIImode} -#decho off set LogAfter [trinfo res] -#decho on set status 1 if { ![file exists ${aFile}] } { diff --git a/tests/bugs/xde/bug6366 b/tests/bugs/xde/bug6366 index e3feb8ceb0..40b7dfd550 100755 --- a/tests/bugs/xde/bug6366 +++ b/tests/bugs/xde/bug6366 @@ -2,42 +2,16 @@ puts "============" puts "OCC6366" puts "============" puts "" -###################################################### +############################################################# # FixShape does not fix an edge with invalid SameRange flag -###################################################### +############################################################# set BugNumber OCC6366 restore [locate_data_file BUC60393.rle] a -decho off -if {[checkshape a] != "This shape seems to be valid"} { - puts "Info: we see that the initial shape is bad" -} -decho on -puts "launching fixshape..." fixshape result a -set err 0 +checkshape result -decho off -if {[checkshape result] != "This shape seems to be valid"} { - puts "Info: we see that the fixed shape is bad too" - puts "launching fsameparameter..." - set err 1 - fsameparameter result - if {[checkshape result] == "This shape seems to be valid"} { - puts "Info: we see that fsameparameter fixed the shape completely" - } else { - puts "Info: we see that the fixed shape after fsameparameter is bad too" - } -} -decho on - -if { ${err} == 0 } { - puts "OK ${BugNumber}" -} else { - puts "Faulty ${BugNumber}" -} - -set 2dviewer 0 +set 2dviewer 1 diff --git a/tests/bugs/xde/bug945 b/tests/bugs/xde/bug945 index 6ae44a57a0..06c2a86288 100755 --- a/tests/bugs/xde/bug945 +++ b/tests/bugs/xde/bug945 @@ -2,32 +2,16 @@ puts "=========" puts " OCC945 " puts "=========" puts "" -####################################### -## it is necessary to adapt ShapeFix_Face for correct work -####################################### +############################################################## +# It is necessary to adapt ShapeFix_Face for correct work +############################################################## restore [locate_data_file OCC945.brep] a -decho off -set che [checkshape a] -decho on -if { [regexp "Faulty" $che] == 1 } { - puts "OCC945: Source shape is invalid." -} else { - puts "OCC945: Source shape is valid." -} - if [catch {fixshape result a 29.9 } res] { puts "Faulty OCC945: here is problem with FIXSHAPE function" -} else { - decho off - set che1 [checkshape result] - decho on - if { [regexp "Faulty" $che1] == 1 } { - puts "Faulty OCC945: function FIXSHAPE works WRONGLY." - } else { - puts "OCC945 OK: function FIXSHAPE works PROPERLY." - } } +checkshape result + set 2dviewer 1